mirror of
https://github.com/coder/coder.git
synced 2026-09-24 15:04:27 +08:00
fix: break word to wrap long strings in stats, add media query (#2310)
* break word to wrap long strings, add media query * add stories for smaller screens
This commit is contained in:
@@ -23,3 +23,24 @@ UsedByMany.args = {
|
||||
},
|
||||
activeVersion: Mocks.MockTemplateVersion,
|
||||
}
|
||||
|
||||
export const LongTemplateVersion = Template.bind({})
|
||||
LongTemplateVersion.args = {
|
||||
template: Mocks.MockTemplate,
|
||||
activeVersion: {
|
||||
...Mocks.MockTemplateVersion,
|
||||
name: "thisisareallyreallylongnamefortesting",
|
||||
},
|
||||
}
|
||||
LongTemplateVersion.parameters = {
|
||||
chromatic: { viewports: [960] },
|
||||
}
|
||||
|
||||
export const SmallViewport = Template.bind({})
|
||||
SmallViewport.args = {
|
||||
template: Mocks.MockTemplate,
|
||||
activeVersion: Mocks.MockTemplateVersion,
|
||||
}
|
||||
SmallViewport.parameters = {
|
||||
chromatic: { viewports: [600] },
|
||||
}
|
||||
|
||||
@@ -66,6 +66,9 @@ const useStyles = makeStyles((theme) => ({
|
||||
color: theme.palette.text.secondary,
|
||||
fontFamily: MONOSPACE_FONT_FAMILY,
|
||||
border: `1px solid ${theme.palette.divider}`,
|
||||
[theme.breakpoints.down("sm")]: {
|
||||
display: "block",
|
||||
},
|
||||
},
|
||||
|
||||
statItem: {
|
||||
@@ -79,12 +82,14 @@ const useStyles = makeStyles((theme) => ({
|
||||
textTransform: "uppercase",
|
||||
display: "block",
|
||||
fontWeight: 600,
|
||||
wordWrap: "break-word",
|
||||
},
|
||||
|
||||
statsValue: {
|
||||
fontSize: 16,
|
||||
marginTop: theme.spacing(0.25),
|
||||
display: "inline-block",
|
||||
display: "block",
|
||||
wordWrap: "break-word",
|
||||
},
|
||||
|
||||
statsDivider: {
|
||||
@@ -92,5 +97,8 @@ const useStyles = makeStyles((theme) => ({
|
||||
height: theme.spacing(5),
|
||||
backgroundColor: theme.palette.divider,
|
||||
marginRight: theme.spacing(2),
|
||||
[theme.breakpoints.down("sm")]: {
|
||||
display: "none",
|
||||
},
|
||||
},
|
||||
}))
|
||||
|
||||
@@ -66,6 +66,9 @@ const useStyles = makeStyles((theme) => ({
|
||||
color: theme.palette.text.secondary,
|
||||
fontFamily: MONOSPACE_FONT_FAMILY,
|
||||
border: `1px solid ${theme.palette.divider}`,
|
||||
[theme.breakpoints.down("sm")]: {
|
||||
display: "block",
|
||||
},
|
||||
},
|
||||
|
||||
statItem: {
|
||||
@@ -79,12 +82,14 @@ const useStyles = makeStyles((theme) => ({
|
||||
textTransform: "uppercase",
|
||||
display: "block",
|
||||
fontWeight: 600,
|
||||
wordWrap: "break-word",
|
||||
},
|
||||
|
||||
statsValue: {
|
||||
fontSize: 16,
|
||||
marginTop: theme.spacing(0.25),
|
||||
display: "inline-block",
|
||||
display: "block",
|
||||
wordWrap: "break-word",
|
||||
},
|
||||
|
||||
statsDivider: {
|
||||
@@ -92,6 +97,9 @@ const useStyles = makeStyles((theme) => ({
|
||||
height: theme.spacing(5),
|
||||
backgroundColor: theme.palette.divider,
|
||||
marginRight: theme.spacing(2),
|
||||
[theme.breakpoints.down("sm")]: {
|
||||
display: "none",
|
||||
},
|
||||
},
|
||||
|
||||
capitalize: {
|
||||
|
||||
@@ -82,6 +82,9 @@ const useStyles = makeStyles((theme) => ({
|
||||
color: theme.palette.text.secondary,
|
||||
fontFamily: MONOSPACE_FONT_FAMILY,
|
||||
margin: "0px",
|
||||
[theme.breakpoints.down("sm")]: {
|
||||
display: "block",
|
||||
},
|
||||
},
|
||||
|
||||
statItem: {
|
||||
@@ -95,12 +98,14 @@ const useStyles = makeStyles((theme) => ({
|
||||
textTransform: "uppercase",
|
||||
display: "block",
|
||||
fontWeight: 600,
|
||||
wordWrap: "break-word",
|
||||
},
|
||||
|
||||
statsValue: {
|
||||
fontSize: 16,
|
||||
marginTop: theme.spacing(0.25),
|
||||
display: "inline-block",
|
||||
display: "block",
|
||||
wordWrap: "break-word",
|
||||
},
|
||||
|
||||
statsDivider: {
|
||||
@@ -108,6 +113,9 @@ const useStyles = makeStyles((theme) => ({
|
||||
height: theme.spacing(5),
|
||||
backgroundColor: theme.palette.divider,
|
||||
marginRight: theme.spacing(2),
|
||||
[theme.breakpoints.down("sm")]: {
|
||||
display: "none",
|
||||
},
|
||||
},
|
||||
|
||||
capitalize: {
|
||||
|
||||
@@ -15,3 +15,13 @@ Example.args = {
|
||||
activeTemplateVersion: Mocks.MockTemplateVersion,
|
||||
templateResources: [Mocks.MockWorkspaceResource, Mocks.MockWorkspaceResource2],
|
||||
}
|
||||
|
||||
export const SmallViewport = Template.bind({})
|
||||
SmallViewport.args = {
|
||||
template: Mocks.MockTemplate,
|
||||
activeTemplateVersion: Mocks.MockTemplateVersion,
|
||||
templateResources: [Mocks.MockWorkspaceResource, Mocks.MockWorkspaceResource2],
|
||||
}
|
||||
SmallViewport.parameters = {
|
||||
chromatic: { viewports: [600] },
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user