-
Notifications
You must be signed in to change notification settings - Fork 579
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: Add the template page #1754
Conversation
@@ -143,4 +144,12 @@ const useStyles = makeStyles((theme) => ({ | |||
marginRight: theme.spacing(1.5), | |||
}, | |||
}, | |||
|
|||
operatingSystem: { | |||
fontSize: 14, |
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.
should we try to use a typography
property here?
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.
Probably yes
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 there are more styles involved I will keep it right now.
site/src/components/TemplateResourcesTable/TemplateResourcesTable.tsx
Outdated
Show resolved
Hide resolved
const { template } = useParams() | ||
|
||
if (!template) { | ||
throw new Error("No template found in the URL") |
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.
Should we just redirect?
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 is a "never" state because react-router-dom is handling that for us but I'm doing this here to make TS happy and return the correct type.
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: Comment could help clarify that
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 looks so spiffy! Really nice job.
site/src/hooks/useOrganizationID.ts
Outdated
|
||
export const useOrganizationID = (): string => { | ||
const xServices = useContext(XServiceContext) | ||
const [authState] = useActor(xServices.authXService) |
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 think we should do useInterpret
and useSelector
here so it doesn't cause rerenders for any data except the org id.
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 this is getting authentication data which is a global state I would use the XServiceContext. About the selector for organization Id, I think it is a good idea.
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.
Oh you're right, we don't need useInterpret
here. But I think we should not have useActor
. In fact I don't know if we need a hook for this, you could do it like this
const myOrgId = useSelector(xServices.authXService, selectOrgId) |
Closes #1734