Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

chore: use emotion for styling (pt. 8)#10447

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 ourterms of service andprivacy statement. We’ll occasionally send you account related emails.

Already on GitHub?Sign in to your account

Merged
aslilac merged 23 commits intomainfromemotional-damage-8
Nov 1, 2023
Merged
Show file tree
Hide file tree
Changes fromall commits
Commits
Show all changes
23 commits
Select commitHold shift + click to select a range
b1a8951
emotion: `Sidebar`
aslilacOct 31, 2023
44ff69b
emotion: `CliAuthPageView`
aslilacOct 31, 2023
a87148e
emotion: `AppearanceSettingsPageView`
aslilacOct 31, 2023
42f5b5d
emotion: `NotFoundPage`
aslilacOct 31, 2023
7f3cff2
emotion: `VariableInput`
aslilacOct 31, 2023
aff4560
🧹
aslilacOct 31, 2023
1c519da
emotion: `GroupPage`
aslilacOct 31, 2023
f1cd22e
emotion: `ChartSection`
aslilacOct 31, 2023
c04d181
emotion: `DividerWithText`
aslilacOct 31, 2023
b58f25e
emotion: `HealthPage`
aslilacOct 31, 2023
b94ec5d
emotion: `ExternalAuthPageView`
aslilacOct 31, 2023
641ede7
emotion: `TemplateDocsPage`
aslilacOct 31, 2023
f06631b
emotion: `AuditLogDiff`
aslilacOct 31, 2023
2958685
emotion: `SignInForm`
aslilacOct 31, 2023
9eec598
emotion: `LicenseCard`
aslilacOct 31, 2023
0cbd32b
emotion: `AuditLogRow`
aslilacOct 31, 2023
3cd4cc3
emotion: `ExternalAuthSettingsPageView`
aslilacOct 31, 2023
a872acd
emotion: `AddNewLicensePageView`
aslilacOct 31, 2023
f17fdb1
emotion: `OAuthSignInForm`
aslilacOct 31, 2023
b3accde
emotion: `LoginPageView`
aslilacOct 31, 2023
d84bf88
emotion: `Logs`
aslilacOct 31, 2023
14dcfc8
Merge branch 'main' into emotional-damage-8
aslilacNov 1, 2023
36af836
🧹
aslilacNov 1, 2023
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
54 changes: 21 additions & 33 deletionssite/src/components/Stats/Stats.tsx
View file
Open in desktop
Original file line numberDiff line numberDiff line change
@@ -1,40 +1,28 @@
import Box from "@mui/material/Box"
import { makeStyles } from "@mui/styles"
import { ComponentProps, FC, PropsWithChildren } from "react"
import { combineClasses } from "utils/combineClasses"
import { type CSSObject, type Interpolation, type Theme } from "@emotion/react";
import Box from "@mui/material/Box";
import { type ComponentProps, type FC } from "react";

export const Stats: FC<ComponentProps<typeof Box>> = (props) => {
const styles = useStyles()
return (
<Box
{...props}
className={combineClasses([styles.stats, props.className])}
/>
)
}
return <Box {...props} css={styles.stats} />;
};

export const StatsItem: FC<
{
label: string
value: string | number | JSX.Element
label: string;
value: string | number | JSX.Element;
} & ComponentProps<typeof Box>
> = ({ label, value, ...divProps }) => {
const styles = useStyles()

return (
<Box
{...divProps}
className={combineClasses([styles.statItem, divProps.className])}
>
<span className={styles.statsLabel}>{label}:</span>
<span className={styles.statsValue}>{value}</span>
<Box {...divProps} css={styles.statItem}>
<span css={styles.statsLabel}>{label}:</span>
<span css={styles.statsValue}>{value}</span>
</Box>
)
}
);
};

constuseStyles =makeStyles((theme) => ({
stats: {
...theme.typography.body2,
conststyles = {
stats:(theme) => ({
...(theme.typography.body2 as CSSObject),
paddingLeft: theme.spacing(2),
paddingRight: theme.spacing(2),
borderRadius: theme.shape.borderRadius,
Expand All@@ -49,9 +37,9 @@ const useStyles = makeStyles((theme) => ({
display: "block",
padding: theme.spacing(2),
},
},
}),

statItem: {
statItem:(theme) => ({
padding: theme.spacing(1.75),
paddingLeft: theme.spacing(2),
paddingRight: theme.spacing(2),
Expand All@@ -62,14 +50,14 @@ const useStyles = makeStyles((theme) => ({
[theme.breakpoints.down("md")]: {
padding: theme.spacing(1),
},
},
}),

statsLabel: {
display: "block",
wordWrap: "break-word",
},

statsValue: {
statsValue:(theme) => ({
marginTop: theme.spacing(0.25),
display: "flex",
wordWrap: "break-word",
Expand All@@ -85,5 +73,5 @@ const useStyles = makeStyles((theme) => ({
textDecoration: "underline",
},
},
},
}))
}),
} satisfies Record<string, Interpolation<Theme>>;
66 changes: 28 additions & 38 deletionssite/src/components/WorkspaceBuildLogs/Logs.tsx
View file
Open in desktop
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,9 @@
import {makeStyles} from "@mui/styles";
import { LogLevel } from "api/typesGenerated";
import {type Interpolation, type Theme} from "@emotion/react";
importtype{ LogLevel } from "api/typesGenerated";
import dayjs from "dayjs";
import { FC, useMemo } from "react";
import { MONOSPACE_FONT_FAMILY } from "theme/constants";
import { combineClasses } from "utils/combineClasses";
import { type FC, type ReactNode, useMemo } from "react";
import AnsiToHTML from "ansi-to-html";
import { MONOSPACE_FONT_FAMILY } from "theme/constants";

export interface Line {
time: string;
Expand All@@ -24,19 +23,17 @@ export const Logs: FC<React.PropsWithChildren<LogsProps>> = ({
lines,
className = "",
}) => {
const styles = useStyles();

return (
<divclassName={combineClasses([className,styles.root])}>
<divclassName={styles.scrollWrapper}>
<divcss={styles.root} className={className}>
<divcss={styles.scrollWrapper}>
{lines.map((line, idx) => (
<divclassName={combineClasses([styles.line,line.level])} key={idx}>
<divcss={styles.line} className={line.level} key={idx}>
{!hideTimestamps && (
<>
<spanclassName={styles.time}>
<spancss={styles.time}>
{dayjs(line.time).format(`HH:mm:ss.SSS`)}
</span>
<spanclassName={styles.space} />
<spancss={styles.space} />
</>
)}
<span>{line.output}</span>
Expand All@@ -56,39 +53,32 @@ export const LogLine: FC<{
hideTimestamp?: boolean;
number?: number;
style?: React.CSSProperties;
sourceIcon?:JSX.Element;
sourceIcon?:ReactNode;
maxNumber?: number;
}> = ({ line, hideTimestamp, number, maxNumber, sourceIcon, style }) => {
const styles = useStyles();
const output = useMemo(() => {
return convert.toHtml(line.output.split(/\r/g).pop() as string);
}, [line.output]);
const isUsingLineNumber = number !== undefined;

return (
<div
className={combineClasses([
styles.line,
line.level,
isUsingLineNumber && styles.lineNumber,
])}
css={[styles.line, isUsingLineNumber && styles.lineNumber]}
className={line.level}
style={style}
>
{sourceIcon}
{!hideTimestamp && (
<>
<span
className={combineClasses([
styles.time,
isUsingLineNumber && styles.number,
])}
css={[styles.time, isUsingLineNumber && styles.number]}
style={{
minWidth: `${maxNumber ? maxNumber.toString().length - 1 : 0}em`,
}}
>
{number ? number : dayjs(line.time).format(`HH:mm:ss.SSS`)}
</span>
<spanclassName={styles.space} />
<spancss={styles.space} />
</>
)}
<span
Expand All@@ -100,8 +90,8 @@ export const LogLine: FC<{
);
};

constuseStyles =makeStyles((theme) => ({
root: {
conststyles = {
root:(theme) => ({
minHeight: 156,
padding: theme.spacing(1, 0),
borderRadius: theme.shape.borderRadius,
Expand All@@ -112,11 +102,11 @@ const useStyles = makeStyles((theme) => ({
borderBottom: `1px solid ${theme.palette.divider}`,
borderRadius: 0,
},
},
}),
scrollWrapper: {
minWidth: "fit-content",
},
line: {
line:(theme) => ({
wordBreak: "break-all",
display: "flex",
alignItems: "center",
Expand All@@ -139,24 +129,24 @@ const useStyles = makeStyles((theme) => ({
"&.warn": {
backgroundColor: theme.palette.warning.dark,
},
},
lineNumber: {
}),
lineNumber:(theme) => ({
paddingLeft: theme.spacing(2),
},
space: {
}),
space:(theme) => ({
userSelect: "none",
width: theme.spacing(3),
display: "block",
flexShrink: 0,
},
time: {
}),
time:(theme) => ({
userSelect: "none",
whiteSpace: "pre",
display: "inline-block",
color: theme.palette.text.secondary,
},
number: {
}),
number:(theme) => ({
width: theme.spacing(4),
textAlign: "right",
},
}));
}),
} satisfies Record<string, Interpolation<Theme>>;
40 changes: 18 additions & 22 deletionssite/src/pages/404Page/404Page.tsx
View file
Open in desktop
Original file line numberDiff line numberDiff line change
@@ -1,34 +1,30 @@
import { makeStyles } from "@mui/styles";
import Typography from "@mui/material/Typography";
import { FC } from "react";
import {typeFC } from "react";

export const NotFoundPage: FC = () => {
const styles = useStyles();

return (
<div className={styles.root}>
<div className={styles.headingContainer}>
<div
css={{
width: "100%",
height: "100%",
display: "flex",
flexDirection: "row",
justifyContent: "center",
alignItems: "center",
}}
>
<div
css={(theme) => ({
margin: theme.spacing(1),
padding: theme.spacing(1),
borderRight: theme.palette.divider,
})}
>
<Typography variant="h4">404</Typography>
</div>
<Typography variant="body2">This page could not be found.</Typography>
</div>
);
};

const useStyles = makeStyles((theme) => ({
root: {
width: "100%",
height: "100%",
display: "flex",
flexDirection: "row",
justifyContent: "center",
alignItems: "center",
},
headingContainer: {
margin: theme.spacing(1),
padding: theme.spacing(1),
borderRight: theme.palette.divider,
},
}));

export default NotFoundPage;
Loading

[8]ページ先頭

©2009-2025 Movatter.jp