Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: Clean up no-results page #420

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Binary file removed src/features/Results/NoResults/NoResults.jpeg
Binary file not shown.
16 changes: 9 additions & 7 deletions src/features/Results/NoResults/NoResults.styled.tsx
Original file line number Diff line number Diff line change
@@ -1,14 +1,16 @@
import styled from 'styled-components';
import { spacings } from '../../../tokens/spacings';
import { theme } from '../../../tokens/theme';

const StyledImg = styled.img`
scale: 85%;
`;
export const TextDiv = styled.div`
export const NoResults = styled.div`
display: flex;
flex-direction: column;
align-items: center;

row-gap: ${spacings.MEDIUM};
padding: ${spacings.X_LARGE};

a {
color: ${theme.light.primary.resting};
display: inline-block;
margin-inline: 0.2em;
}
`;
export { StyledImg as Img };
33 changes: 11 additions & 22 deletions src/features/Results/NoResults/NoResults.tsx
Original file line number Diff line number Diff line change
@@ -1,29 +1,18 @@
import { Typography } from '@equinor/eds-core-react';
import { InfoPageComponent } from '../../../components/InfoPageComponent/InfoPageComponent';
import NoResultPicture from './NoResults.jpeg';
import * as Styled from './NoResults.styled';
import { Link } from 'react-router-dom';
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
import { Link } from 'react-router-dom';
import { Link, useLocation } from 'react-router-dom';


export const NoResults = () => {
return (
Copy link
Collaborator

@mheggelund mheggelund Jan 2, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
return (
return (
const location = useLocation();

<InfoPageComponent scaleHight="true">
<Styled.Img src={NoResultPicture} alt="altText" />
<Styled.TextDiv>
<Typography variant="h4">
Oh no! It seems we don’t have any results for this model yet
</Typography>
<Typography variant="body_long">
To get started, try adding cases to the <span>&nbsp;</span>
<Typography link href={'../compute/variogram'}>
variogram
</Typography>
<span>&nbsp;</span>
or <span>&nbsp;</span>
<Typography link href={'../compute/object'}>
object
</Typography>
<span>&nbsp;</span> page.
</Typography>
</Styled.TextDiv>
</InfoPageComponent>
<Styled.NoResults>
<Typography variant="h2">No results found</Typography>
<Typography variant="body_long">
Please check your compute settings for
<Link to={'../compute/variogram'}>variogram</Link>
or
<Link to={'../compute/object'}>object</Link>
cases.
</Typography>
</Styled.NoResults>
Comment on lines +7 to +16
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
<Styled.NoResults>
<Typography variant="h2">No results found</Typography>
<Typography variant="body_long">
Please check your compute settings for
<Link to={'../compute/variogram'}>variogram</Link>
or
<Link to={'../compute/object'}>object</Link>
cases.
</Typography>
</Styled.NoResults>
<Styled.NoResults>
<Typography variant="h2">No results found</Typography>
<Typography variant="body_long">
Please check your compute settings for
{location.pathname.includes('variogram') && (
<Link to={'../compute/variogram'}>variogram</Link>
)}
{location.pathname.includes('object') && (
<Link to={'../compute/object'}>object</Link>
)}
case.
</Typography>
</Styled.NoResults>

);
};
Loading