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

PT-510 | Accessibility improvements #53

Merged
merged 7 commits into from Oct 13, 2020
Merged

Conversation

Sartonon
Copy link
Contributor

@Sartonon Sartonon commented Oct 9, 2020

Description

  • Event card to links
  • Font size and spacing adjustments for table
  • Default alt text for event image
  • Delete react-i18next dependency and update imports

Issues

Related

PT-510:

@@ -13,10 +15,11 @@ import styles from './eventCard.module.scss';

interface Props {
event: EventFieldsFragment;
link: string;
onClick?: (id: string) => void;
Copy link
Contributor

Choose a reason for hiding this comment

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

Could remove unused property

<div className={styles.textWithIcon}>
<IconClock />
{time}
<Link href={link}>
Copy link
Contributor

Choose a reason for hiding this comment

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

I think that the dynamic routing is not working properly here. When I'm clicking event card i get this error message
Näyttökuva 2020-10-9 kello 14 34 50
And on event page
Näyttökuva 2020-10-9 kello 14 30 34

You can fix this by adding as prop to Link
e.g.

<Link
      href={`${ROUTES.EVENT_DETAILS.replace(':id', '[eventId]')}?eventId=${
        event.id
      }`}
      as={ROUTES.EVENT_DETAILS.replace(':id', event.id)}
    >

More info can be found here i18next/next-i18next#413

Copy link
Contributor Author

Choose a reason for hiding this comment

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

hmm next docs mention that this props is used before version Next.js 9.5.3. Need to check if updating next would help 🤔

Copy link
Contributor Author

Choose a reason for hiding this comment

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

And I think I have seen that error evenr before when running locally

Copy link
Contributor

Choose a reason for hiding this comment

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

The problem existed already before this PR. next-i18next still seems to use 'as' prop internally. Here's source code for that component https://github.com/isaachinman/next-i18next/blob/master/src/components/Link.tsx

But hopefully just updating next.js to latest version does the magic

@Sartonon
Copy link
Contributor Author

couldn't get this https://github.com/isaachinman/next-i18next/blob/master/examples/simple/next.config.js example working, publicRuntimeConfig was always undefined

@Sartonon
Copy link
Contributor Author

And importing to next.config.js threw error, I will try again :)

@jorilindell
Copy link
Contributor

And importing to next.config.js threw error, I will try again :)

You could try using require. But it really isn't a big deal

@Sartonon
Copy link
Contributor Author

that didn't work but next/config started working, maybe the problem was with the sass config hoc or something

Copy link
Contributor

@jorilindell jorilindell left a comment

Choose a reason for hiding this comment

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

Very good

@Sartonon Sartonon merged commit f446077 into develop Oct 13, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants