-
Notifications
You must be signed in to change notification settings - Fork 2
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: Access team secondary colour via MUI theme #2646
Conversation
Removed vultr server and associated DNS entries |
851d8a6
to
22266c2
Compare
🤖 Hasura Change Summary compared a subset of table metadata including permissions: Updated Tables (1)
|
0911bf6
to
f38844d
Compare
|
||
const DEFAULT_PRIMARY_COLOR = "#0010A4"; | ||
const DEFAULT_TONAL_OFFSET = 0.2; |
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.
No change here, this is just the MUI default we're currently using.
Docs: https://mui.com/material-ui/customization/palette/#tonal-offset
prompt: { | ||
main: DEFAULT_PRIMARY_COLOR, | ||
contrastText: "#FFFFFF", | ||
light: lighten(DEFAULT_PRIMARY_COLOR, DEFAULT_TONAL_OFFSET), | ||
dark: darken(DEFAULT_PRIMARY_COLOR, DEFAULT_TONAL_OFFSET), | ||
}, |
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 is an augmentColor()
utility to handle this automatically, but it only happens after a theme has been generated so I'm doing this manually here.
Docs: https://mui.com/material-ui/customization/palette/#generate-tokens-using-augmentcolor-utility
@@ -1,3 +1,5 @@ | |||
-- TODO: Update to add action_color and link_colour columns |
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.
Intentional TODO
, will need to come back to pick this up post-deploy to production.
@@ -25,10 +25,14 @@ declare module "@mui/material/styles" { | |||
declare module "@mui/material/styles/createPalette" { | |||
interface Palette { | |||
border: { main: string; input: string; light: string }; | |||
link: { main: string; }; | |||
prompt: { main: string; contrastText: string; light: string; dark: string; }; |
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'll be honest, not a huge fan of prompt
but it was the best worst option here 😅 Very open to other suggestions.
"Action" is already used by MUI in a different context, "Button" feels a bit odd / meaningless -
<Button color="button">
Continue
</Button>
f38844d
to
23e8eae
Compare
## What does this PR do? - Updates types to reflect changes implemented in theopensystemslab/planx-new#2646 - Exports `Team` types
What does this PR do?
team_themes
table to includeaction_colour
andlink_colour
columns, and dropssecondary_colour
columnTeam
and associated types fromplanx-core
team_themes
types planx-core#259Not in this PR
link_colour
value in the database is set to the current defaultcolor="prompt"
is not used anywhere yet so this value is not pulled in and usedIf you wish to do so, you can test this locally by updating colours for a team in Hasura and then see them get picked up in
/preview
and/unpublished
routes. You'll need to setcolor="prompt"
on a component (e.g. button) to see theaction_colour
feeding through.