-
Notifications
You must be signed in to change notification settings - Fork 579
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: Add selected template link at the template select field (#1918)
- Loading branch information
1 parent
75bcb73
commit 65c17a0
Showing
10 changed files
with
166 additions
and
124 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,18 +1,30 @@ | ||
import { makeStyles } from "@material-ui/core/styles" | ||
import { FC } from "react" | ||
import { maxWidth, sidePadding } from "../../theme/constants" | ||
import { containerWidth, sidePadding } from "../../theme/constants" | ||
|
||
type Size = "regular" | "medium" | "small" | ||
|
||
const widthBySize: Record<Size, number> = { | ||
regular: containerWidth, | ||
medium: containerWidth / 2, | ||
small: containerWidth / 3, | ||
} | ||
|
||
const useStyles = makeStyles(() => ({ | ||
margins: { | ||
margin: "0 auto", | ||
maxWidth, | ||
padding: `0 ${sidePadding}`, | ||
maxWidth: ({ maxWidth }: { maxWidth: number }) => maxWidth, | ||
padding: `0 ${sidePadding}px`, | ||
flex: 1, | ||
width: "100%", | ||
}, | ||
})) | ||
|
||
export const Margins: FC = ({ children }) => { | ||
const styles = useStyles() | ||
interface MarginsProps { | ||
size?: Size | ||
} | ||
|
||
export const Margins: FC<MarginsProps> = ({ children, size = "regular" }) => { | ||
const styles = useStyles({ maxWidth: widthBySize[size] }) | ||
return <div className={styles.margins}>{children}</div> | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.