-
Notifications
You must be signed in to change notification settings - Fork 2.4k
add skeleton to templates and start #3952
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
Conversation
|
Build for latest commit cfef2cb is at https://pr3952.build.csb.dev/s/new. |
|
Visual regressions fail because of limit |
| ITextProps; | ||
| ITextProps & { | ||
| as?: any; | ||
| to?: 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.
not sure if this is the best way to do it, but we'll find out 🤷
sad. let's find a way to run them only when needed for next month cc @lbogdan |
| ); | ||
|
|
||
| // export default withRouter(Content); | ||
| export const Content = withRouter(ContentComponent); |
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 need for withRouter here, since we're not using any of the passed props.
https://reacttraining.com/react-router/core/api/withRouter
| export const Content = withRouter(ContentComponent); |
| // <Redirect to="/dashboard/recent" /> | ||
| // </Switch> | ||
| // ); | ||
| const ContentComponent = () => ( |
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.
| const ContentComponent = () => ( | |
| export const Content: FunctionComponent = () => ( |
| @@ -1,5 +1,5 @@ | |||
| // import React from 'react'; | |||
| // import { Route, Switch, Redirect, withRouter } from 'react-router-dom'; | |||
| import React from 'react'; | |||
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.
| import React from 'react'; | |
| import React, { FunctionComponent } from 'react'; |
| export const SandboxCard = ({ sandbox }) => ( | ||
| <Element> | ||
| <Link href={sandboxUrl({ id: sandbox.id, alias: sandbox.alias })}> | ||
| {sandbox.title || sandbox.alias || sandbox.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.
You can use getSandboxName from common/utils instead
| {sandbox.title || sandbox.alias || sandbox.id} | |
| {getSandboxName(sandbox)} |
| @@ -0,0 +1,11 @@ | |||
| import React from 'react'; | |||
| import { sandboxUrl } from '@codesandbox/common/lib/utils/url-generator'; | |||
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.
| import { sandboxUrl } from '@codesandbox/common/lib/utils/url-generator'; | |
| import { getSandboxName } from '@codesandbox/common/lib/utils/get-sandbox-name'; | |
| import { sandboxUrl } from '@codesandbox/common/lib/utils/url-generator'; |
| return <Text>loading</Text>; | ||
| } | ||
|
|
||
| const sandboxes = data && data.me && data.me.sandboxes; |
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 know for sure there's no error or loading state, we know data.me.sandboxes is present
| const sandboxes = data && data.me && data.me.sandboxes; | |
| const sandboxes = data.me.sandboxes; |
| const templates = | ||
| templatesData && | ||
| templatesData.me && | ||
| templatesData.me.recentlyUsedTemplates.slice(0, 4); |
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 know for sure there's no error or loading state, we know templatesData.me.recentlyUsedTemplates is present
| const templates = | |
| templatesData && | |
| templatesData.me && | |
| templatesData.me.recentlyUsedTemplates.slice(0, 4); | |
| const templates = templatesData.me.recentlyUsedTemplates.slice(0, 4); |
| return <Text>loading</Text>; | ||
| } | ||
|
|
||
| const templates = data && data.me && data.me.templates; |
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 know for sure there's no error or loading state, we know data.me.templates is present
| const templates = data && data.me && data.me.templates; | |
| const templates = data.me.templates; |
| // import React from 'react'; | ||
| // import { Route, Switch, Redirect, withRouter } from 'react-router-dom'; | ||
| import React from 'react'; | ||
| import { Route, Switch, Redirect, withRouter } from 'react-router-dom'; |
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.
| import { Route, Switch, Redirect, withRouter } from 'react-router-dom'; | |
| import { Redirect, Route, Switch } from 'react-router-dom'; |
Closes CSB-79