Skip to content

Commit

Permalink
[Platform]: aotf api query bug and link text decoration (#351)
Browse files Browse the repository at this point in the history
* aotf api query bug and link text decoration

* removing page text
  • Loading branch information
chinmehta authored Mar 18, 2024
1 parent af08a37 commit 5226a16
Show file tree
Hide file tree
Showing 6 changed files with 34 additions and 16 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -187,7 +187,7 @@ function CellName({ cell, colorScale }) {
<ListItemIcon>
<FontAwesomeIcon icon={faArrowUpRightFromSquare} />
</ListItemIcon>
<ListItemText>Navigate to evidence page</ListItemText>
<ListItemText>Navigate to evidence</ListItemText>
</StyledMenuItem>
<Divider />
<StyledMenuItem onClick={handleNavigateToProfile}>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,8 @@ function AssociationsWrapper() {
dataSourcesRequired,
} = useAotfContext();

const aggregationFilters = dataSourcesRequired.map(({ id, ...obj }) => ({ ...obj }));

const variables = {
id,
index: pagination.pageIndex,
Expand All @@ -38,7 +40,7 @@ function AssociationsWrapper() {
enableIndirect,
datasources: dataSourcesWeights,
entity,
aggregationFilters: dataSourcesRequired,
aggregationFilters,
};

if (initialLoading) return <AotFLoader />;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,8 @@ function AssociationsWrapper() {
dataSourcesRequired,
} = useContext(AssociationsContext);

const aggregationFilters = dataSourcesRequired.map(({ id, ...obj }) => ({ ...obj }));

const variables = {
id,
index: pagination.pageIndex,
Expand All @@ -38,7 +40,7 @@ function AssociationsWrapper() {
enableIndirect,
datasources: dataSourcesWeights,
entity,
aggregationFilters: dataSourcesRequired,
aggregationFilters,
};

if (initialLoading) return <AotFLoader />;
Expand Down
2 changes: 1 addition & 1 deletion packages/ui/src/components/Footer.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ const FooterLink = ({ label, url, icon }) => {

const FooterSectionHeading = ({ children }) => (
<Grid item xs={12}>
<Typography color="inherit">{children}</Typography>
<Typography variant="h6" color="inherit">{children}</Typography>
</Grid>
);

Expand Down
4 changes: 4 additions & 0 deletions packages/ui/src/components/Link.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -28,8 +28,12 @@ const useStyles = makeStyles(theme => ({
},
baseFooter: {
color: "white",
"text-decoration-color": "transparent",
"-webkit-text-decoration-color": "transparent",
"&:hover": {
color: theme.palette.primary.light,
"text-decoration-color": theme.palette.primary.light,
"-webkit-text-decoration-color": theme.palette.primary.light,
},
display: "flex",
alignItems: "center",
Expand Down
34 changes: 22 additions & 12 deletions packages/ui/src/components/NavBar.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ import {
MenuItem,
MenuList,
useMediaQuery,
Box,
} from "@mui/material";
import { makeStyles, useTheme } from "@mui/styles";
import { styled } from "@mui/material/styles";
Expand Down Expand Up @@ -58,6 +59,8 @@ const useStyles = makeStyles(theme => ({
},
menuLink: {
color: theme.palette.secondary.contrastText,
margin: `0 ${theme.spacing(2)}`,
whiteSpace: "nowrap",
"&:hover": {
color: theme.palette.secondary.contrastText,
},
Expand Down Expand Up @@ -144,28 +147,35 @@ function NavBar({ name, search, api, downloads, docs, contact, homepage, items,
{items && !isHomePageRegular ? <HeaderMenu items={items} placement={placement} /> : null}

{isHomePageRegular && (
<MenuList className={classes.menuList}>
<Box sx={{ display: "flex" }}>
{items.map(item => {
if (item.showOnlyPartner) {
return (
<PrivateWrapper key={v1()}>
<MenuItem dense className={classes.menuItem}>
<Link external={item.external} to={item.url} className={classes.menuLink}>
{item.name}
</Link>
</MenuItem>
<Link
footer
external={item.external}
to={item.url}
className={classes.menuLink}
>
<Typography variant="body2">{item.name}</Typography>
</Link>
</PrivateWrapper>
);
}
return (
<MenuItem key={v1()} dense className={classes.menuItem}>
<Link external={item.external} to={item.url} className={classes.menuLink}>
{item.name}
</Link>
</MenuItem>
<Link
key={v1()}
footer
external={item.external}
to={item.url}
className={classes.menuLink}
>
<Typography variant="body2">{item.name}</Typography>
</Link>
);
})}
</MenuList>
</Box>
)}
</div>
</Toolbar>
Expand Down

0 comments on commit 5226a16

Please sign in to comment.