-
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: Editor styles and layout update #2491
Conversation
Removed vultr server and associated DNS entries |
775e0df
to
18ff5f2
Compare
</Box> | ||
</Box> | ||
</> | ||
</EditorRow> |
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.
Since we're planning to do a dev pass-off of this settings panel, this might be a good scenario for a feature flag!
To feature flag this new design panel:
- You could add a new flag value to
AVAILABLE_FEATURE_FLAGS
like "SHOW_TEAM_SETTINGS" insrc/lib/featureFlags.ts
- Then in this file you could call
hasFeatureFlag("SHOW_TEAM_SETTINGS")
to conditionally render either the original "Feature in development" placeholder or the new form inputs here
Does that make sense? Will make it much easier to merge design changes and then pick up dev work in separate PRs without risking confusion of any curious editors in the meantime. To test, you can run window.featureFlags.toggle("SHOW_TEAM_SETTINGS")
in the console
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.
Yes absolutely, makes a lot more sense than extracting into separate PRs, I'll work to get this into this PR.
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.
Looks fantastic, honestly a huge improvement 🎉
A few very minor comments, happy for this to be merged as is and they can be picked up as small follow on PRs - whatever works best for you 👍
should be 32x32px and in .ico or .png format. | ||
</InputDescription> | ||
<InputDescription> | ||
<Link href="https://www.planx.uk"> |
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.
When these get updated we'll also want a target="_blank"
attribute so they open in a new tab 👍
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.
A potential follow on task (in another PR!) might be splitting this /ui
folder into /public
, /editor
and /shared
subfolders.
At the moment the list is pretty big and knowing what components are available and used can be a bit of a challenge!
export default function InputDescription({ | ||
children, | ||
}: { | ||
children: ReactNode; | ||
}) { |
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.
nit: This could be slightly simplified by using the PropsWithChildren
type.
We can annotate the component with something like React.FC<PropsWithChildren>
and it will handle some of this boilerplate for us. There should be a few examples of this in the codebase you can take a look at 👍
paddingBottom: theme.spacing(2), | ||
})); | ||
})) as typeof Typography; |
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.
nit: I believe that the as typeof Typography
is redundant here (and below in Subtitle
). This is only needed when we're using another component type - i.e. passing a prop like component="legend"
into the template.
})); | ||
|
||
export const ModalSubtitle: React.FC<Props> = ({ title }) => ( | ||
<Root sx={{ display: "flex" }}> | ||
<StyledTypography variant="body2">{title}</StyledTypography> | ||
<StyledTypography variant="subtitle2">{title}</StyledTypography> |
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 totally doesn't need to change, but just a heads up that you can feel free to use the sx
prop (or even just p={something}
) when you only have a few style attributes to add to a component.
No hard and fast rules here at all, it's usually nice to abstract style away from structure, but it can be a useful / quick method.
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.
Follow on comment from this morning - in another PR (no rush!) it would be nice to tidy this up and move these styles into a React styled component if possible.
I suspect that ProseMirror (the library used for rich text editing) is looking for these specific class names so it should be a fairly easy port across.
Much appreciated @DafyddLlyr , I'll merge this now to avoid blocking further editor work, and break down the separate tasks as PRs as you suggest. |
What does this PR do?
Two main areas of work addressed:
1. Adding admin setting design feature UI
UI has been added for the following (UI only, no working functionality at present).
Note: I've added example links to guides for each of these elements. I'll make sure these are in place on our PlanX Notion before the work goes live.
As part of this I have created the
EditorRow
UI component with optional background variant, to be used for each row of settings.As guided by @jessicamcinchak this sits behind the feature flag
window.featureFlags.toggle("SHOW_TEAM_SETTINGS")
Preview:
https://2491.planx.pizza/buckinghamshire/find-out-if-you-need-planning-permission/settings/design
2. Updating general editor UI
Interwoven with and as an extension of the above, I've given the editor UI a going over with a focus on the following:
Preview:
https://2491.planx.pizza/opensystemslab/permitteddevelopment,7GeYLgmnm9/nodes/i0uhcaViKg/nodes/CtyInx9nSU/edit