Skip to content
This repository has been archived by the owner on Aug 23, 2023. It is now read-only.

Quote query, graphql-codegen, useTextKeys hook #205

Merged
merged 23 commits into from Dec 12, 2019
Merged

Conversation

gustafguner
Copy link
Contributor

@gustafguner gustafguner commented Dec 12, 2019

  • Generating Apollo hooks with graphql-codegen and replaced old component based with hooks
  • Querying Quote in new offer page
  • Implemented a useTextKeys hook (props to @hedvigoscar for the help) with support for replacements

Using the useTextKeys hook is very straight forward and saves us a lot of component wrapping.

const textKeys = useTextKeys()

<PreHeading>{textKeys.HERO_LABEL}</PreHeading>

<HeadingWhite>
  {textKeys.HERO_HEADLINE.fill({
    FIRST_NAME: offer.member.firstName,
  })}
</HeadingWhite>

@gustafguner gustafguner requested a review from a team December 12, 2019 09:37
sampettersson
sampettersson previously approved these changes Dec 12, 2019
Copy link
Contributor

@sampettersson sampettersson left a comment

Choose a reason for hiding this comment

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

Dope!

src/utils/hooks/useTextKeys.tsx Outdated Show resolved Hide resolved
src/server/page.tsx Show resolved Hide resolved
src/pages/OfferNew/Introduction/Sidebar/StartDate.tsx Outdated Show resolved Hide resolved
Copy link
Contributor

@palmenhq palmenhq left a comment

Choose a reason for hiding this comment

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

really awesome! Just one impelementation detail afai can see

src/utils/hooks/useTextKeys.tsx Outdated Show resolved Hide resolved
src/pages/Embark/index.tsx Outdated Show resolved Hide resolved
@gustafguner gustafguner requested a review from a team December 12, 2019 10:38
oscarnylander
oscarnylander previously approved these changes Dec 12, 2019
Copy link
Contributor

@oscarnylander oscarnylander left a comment

Choose a reason for hiding this comment

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

I like it!

But I'm not sure that we can merge it as is. Maybe we can? Hmm. 🤔

@gustafguner gustafguner merged commit 97a2015 into master Dec 12, 2019
@gustafguner gustafguner deleted the mocked-quote-data branch December 12, 2019 13:47
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants