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(NotFound): Improve 404 page styling #324

Merged
merged 12 commits into from
Oct 14, 2021
Merged

fix(NotFound): Improve 404 page styling #324

merged 12 commits into from
Oct 14, 2021

Conversation

hareetd
Copy link
Contributor

@hareetd hareetd commented Oct 13, 2021

Updates the 404 page to follow the conventions laid out by PatternFly: https://www.patternfly.org/v4/ux-writing/http-404-pages/. I chose not to include the search function or Card header images for simplicity's sake but can try adding those as well if requested.

Fixes #295

Sample:

image

@andrewazores
Copy link
Member

Looks very nice overall. I wonder if it would be worth extracting a function that generates the Card component from an object containing the title, body text, link text, and link path? routes.tsx does essentially this. Something roughly like:

const cards = [
  {
    title: 'About',
    bodyText: 'Access links containing further information about Cryostat',
    linkText: 'View information about Cryostat',
    linkPath: '/about',
  },
];

return (<>

  (
    cards.map(card =>
      <Card className='pf-c-card-not-found'>
        <CardTitle>{card.title}</CardTitle>
        <CardBody>{card.bodyText}</CardBody>
        <CardFooter className='pf-c-card-not-found__footer'>
          <Link to={card.linkPath}>{card.linkText}</Link>
        </CardFooter>
      </Card>
    )
  )

</>);

This would be wrapped inside the rest of the EmptyState component stuff that is already there.

Alternatively, instead of just a generating function like this, you could extract out the card to its own component definition for even cleaner reuse.

@hareetd
Copy link
Contributor Author

hareetd commented Oct 14, 2021

Sounds good, I'll look into the different extraction options.

@hareetd
Copy link
Contributor Author

hareetd commented Oct 14, 2021

With updated text:

image

@andrewazores andrewazores merged commit 7f15186 into cryostatio:main Oct 14, 2021
@hareetd hareetd deleted the improve-404-page-styling branch October 14, 2021 21:33
@ebaron ebaron added the fix label May 12, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Improve "Take me home" button styling
3 participants