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

feat(core): add store selector page and link in footer #1034

Merged
merged 9 commits into from
Jul 11, 2024
Merged

Conversation

jorgemoya
Copy link
Contributor

@jorgemoya jorgemoya commented Jun 25, 2024

What/Why?

  • Add store selector page to change locales.
  • Page can be accessed via footer link (temp design) or /store-selector

Known issues

  • Two latin americas

Testing

Go to /store-selector and switch locales.

Screenshot

Screenshot 2024-06-25 at 3 10 43 PM

@jorgemoya jorgemoya requested a review from a team as a code owner June 25, 2024 18:32
Copy link

vercel bot commented Jun 25, 2024

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Comments Updated (UTC)
catalyst-latest ✅ Ready (Inspect) Visit Preview 💬 Add feedback Jul 9, 2024 6:56pm
5 Skipped Deployments
Name Status Preview Comments Updated (UTC)
catalyst-1millionproducts-store ⬜️ Ignored (Inspect) Visit Preview Jul 9, 2024 6:56pm
catalyst-au ⬜️ Ignored (Inspect) Visit Preview Jul 9, 2024 6:56pm
catalyst-test-store ⬜️ Ignored (Inspect) Visit Preview Jul 9, 2024 6:56pm
catalyst-uk ⬜️ Ignored (Inspect) Visit Preview Jul 9, 2024 6:56pm
catalyst-unstable ⬜️ Ignored (Inspect) Visit Preview Jul 9, 2024 6:56pm

Copy link

changeset-bot bot commented Jun 25, 2024

🦋 Changeset detected

Latest commit: da8b3e9

The changes in this PR will be included in the next version bump.

This PR includes changesets to release 1 package
Name Type
@bigcommerce/catalyst-core Patch

Not sure what this means? Click here to learn what changesets are.

Click here if you're a maintainer who wants to add another changeset to this PR

Comment on lines +73 to +87
<FooterSection className="flex flex-col gap-10 sm:gap-8 sm:py-6 lg:hidden">
<Locale />

<div className="flex w-full flex-col justify-between gap-10 sm:flex-row sm:gap-8">
<PaymentMethods />
{data.settings && <Copyright data={data.settings} />}
</div>
</FooterSection>

<FooterSection className="hidden justify-between gap-8 py-6 lg:flex">
{data.settings && <Copyright data={data.settings} />}
<div className="flex gap-8">
<Locale />
<PaymentMethods />
</div>
Copy link
Contributor Author

@jorgemoya jorgemoya Jun 25, 2024

Choose a reason for hiding this comment

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

Design between mobile/tablet vs desktop differ enough to warrant repeating code imo.

Comment on lines 10 to 12
<Link className="flex gap-2" href="/store-selector">
<Globe /> {locale.toUpperCase()}
</Link>
Copy link
Contributor Author

@jorgemoya jorgemoya Jun 25, 2024

Choose a reason for hiding this comment

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

Will change in different PR.

Comment on lines +12 to +13
// eslint-disable-next-line @typescript-eslint/no-unnecessary-condition
locales.length > 1 && (
Copy link
Contributor Author

Choose a reason for hiding this comment

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

Want to hide this link if there is only one locale, unfortunately had to prevent this rule from applying because when it is only one locale typescript doesn't see the need for this conditional.

Comment on lines +63 to +70
// eslint-disable-next-line @typescript-eslint/no-unnecessary-condition
<LocaleLink key={locale} locale={locale} selected={selectedLocale === locale} />
Copy link
Contributor Author

Choose a reason for hiding this comment

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

Similar issue here, unfortunately had to prevent this rule from applying because when it is only one locale typescript doesn't see the need for this conditional since selectedLocale can only match the current locale.

@jorgemoya
Copy link
Contributor Author

Found an issue with kv store when swapping locales, reverting to draft to fix this.

@jorgemoya
Copy link
Contributor Author

Ready for re-review @bigcommerce/team-catalyst

Copy link
Contributor

github-actions bot commented Jul 9, 2024

⚡️🏠 Lighthouse report

Lighthouse ran against https://catalyst-latest-j9g9mpgyd-bigcommerce-platform.vercel.app

🖥️ Desktop

We ran Lighthouse against the changes on a desktop and produced this report. Here's the summary:

Category Score
🟠 Performance 83
🟢 Accessibility 100
🟢 Best practices 100
🟠 SEO 82

📱 Mobile

We ran Lighthouse against the changes on a mobile and produced this report. Here's the summary:

Category Score
🟢 Performance 97
🟢 Accessibility 100
🟢 Best practices 100
🟠 SEO 85

@jorgemoya jorgemoya added this pull request to the merge queue Jul 11, 2024
Merged via the queue into main with commit e648a62 Jul 11, 2024
12 checks passed
@jorgemoya jorgemoya deleted the store-selector branch July 11, 2024 16:16
@github-actions github-actions bot mentioned this pull request Jul 10, 2024
@jorgemoya jorgemoya restored the store-selector branch July 31, 2024 14:27
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.

3 participants