-
Notifications
You must be signed in to change notification settings - Fork 1
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
[FAD-57] - Add typography #8
Conversation
import React from "react"; | ||
import { DocsContainer as BaseContainer } from "@storybook/addon-docs/blocks"; | ||
import { useDarkMode } from "storybook-dark-mode"; | ||
import { themes } from "@storybook/theming"; | ||
|
||
export const DocsContainer = ({ children, context }) => { | ||
const dark = useDarkMode(); | ||
|
||
return ( | ||
<BaseContainer | ||
context={{ | ||
...context, | ||
storyById: (id) => { | ||
const storyContext = context.storyById(id); | ||
return { | ||
...storyContext, | ||
parameters: { | ||
...storyContext?.parameters, | ||
docs: { | ||
...storyContext?.parameters?.docs, | ||
theme: dark ? themes.dark : themes.light, | ||
}, | ||
}, | ||
}; | ||
}, | ||
}} | ||
> | ||
{children} | ||
</BaseContainer> | ||
); | ||
}; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
lol what a url for a reference
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This component is a solution for dark mode with docs, apparently, they are both addons from the storybook and docs are not currently working with dark mode...
<></> | ||
) : // <HelperText className="mt-2"> | ||
// {/* @ts-expect-error Same as above */} | ||
// Error: {errors[reservedErrorField].message} | ||
// </HelperText> | ||
null} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Old component used by goldfinch. I commented instead of deleting for future references.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Food for thought - this reference is in client2, could we not just delete it outright?
<></> | ||
) : // <HelperText | ||
// className={clsx( | ||
// isError ? "text-state-error" : "text-dark-80", | ||
// "mt-1 text-sm leading-none" | ||
// )} | ||
// > | ||
// {_errorMessage ? _errorMessage : helperText} | ||
// </HelperText> | ||
null} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Old component used by goldfinch. I commented instead of deleting for future references.
) : // <HelperText | ||
// className={clsx( | ||
// isError | ||
// ? "text-clay-500" | ||
// : colorScheme === "light" | ||
// ? "text-sand-500" | ||
// : colorScheme === "dark" | ||
// ? "text-sand-300" | ||
// : null, | ||
// "mt-1 text-sm leading-none" | ||
// )} | ||
// > | ||
// {errorMessage ? errorMessage : helperText} | ||
// </HelperText> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Old component used by goldfinch. I commented instead of deleting for future references.
<></> | ||
) : // <HelperText isError>Error while fetching wallet status</HelperText> | ||
null} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Old component used by goldfinch. I commented instead of deleting it for future reference.
{/* <Paragraph className="mb-8"> | ||
By connecting your wallet, you agree to our{" "} | ||
<Link href="/terms">Terms of Service</Link> and{" "} | ||
<Link href="/privacy">Privacy Policy</Link> | ||
</Paragraph> | ||
</Paragraph> */} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Old component used by goldfinch. I commented instead of deleting it for future reference.
<></> | ||
) : // <HelperText isError className="mb-12"> | ||
// There was a problem fetching data on pools. Shown data may be | ||
// outdated. | ||
// </HelperText> | ||
null} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Old component used by goldfinch. I commented instead of deleting it for future reference.
<></> | ||
) : // <HelperText isError> | ||
// There was a problem fetching data on this pool. Shown data may be | ||
// outdated. | ||
// </HelperText> | ||
null} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Old component used by goldfinch. I commented instead of deleting it for future reference.
<></> | ||
) : // <HelperText isError> | ||
// There was a problem fetching data on the senior pool. Shown data | ||
// may be outdated. | ||
// </HelperText> | ||
null} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Old component used by goldfinch. I commented instead of deleting it for future reference.
<></> | ||
) : // <HelperText className="mt-2"> | ||
// {/* @ts-expect-error Same as above */} | ||
// Error: {errors[reservedErrorField].message} | ||
// </HelperText> | ||
null} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Food for thought - this reference is in client2, could we not just delete it outright?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Awesome..Just a few questions.
className, | ||
...rest | ||
}: BodyTextProps) { | ||
const Component = "p"; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Just asking, is there any reasoning for declaring the component at the top?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
fixed
level === 1 | ||
? "font-bold" | ||
: level < 5 | ||
? "font-semibold" | ||
: medium | ||
? "font-medium" | ||
: "font-semibold", |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I would suggest using objects when there are multiple ternary operations involved.
Something like this,
clsx("font-semibold",{"font-semibold":level < 5,"font-bold":level === 1,"font-medium":medium},className)
Thoughts?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm not quite familiar with this, but I've tested, and doing this way results in wrong results with the fonts. such as:
font-semibold font-semibold
or font-semibold font-bold
Description
This PR includes the dark mode on storybook:
BodyText
Caption
Display
Heading
Link
Checklist
CHANGELOG
has been updated (if appropriate)