File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 1- import "./Row.scss " ;
1+ import { StyledRow } from "./styles " ;
22
33interface RowProps {
44 gap ?: number ;
@@ -11,18 +11,9 @@ function Row({
1111 children,
1212} : React . PropsWithChildren < RowProps > ) {
1313 return (
14- < div
15- className = "row"
16- style = { {
17- display : "flex" ,
18- flexDirection : "row" ,
19- justifyContent : "space-between" ,
20- width,
21- gap,
22- } }
23- >
14+ < StyledRow width = { width } gap = { gap } >
2415 { children }
25- </ div >
16+ </ StyledRow >
2617 ) ;
2718}
2819
Original file line number Diff line number Diff line change 1+ import styled from "@emotion/styled" ;
2+
3+ interface StyledRowProps {
4+ width ?: string | number ;
5+ gap ?: number ;
6+ }
7+ export const StyledRow = styled . div < StyledRowProps > `
8+ display: flex;
9+ flex-direction: row;
10+ justify-content: space-between;
11+ width: ${ ( props ) =>
12+ typeof props . width === "number" ? `${ props . width } px` : props . width } ;
13+ gap: ${ ( props ) =>
14+ typeof props . gap === "number" ? `${ props . gap } px` : props . gap } ;
15+ ` ;
You can’t perform that action at this time.
0 commit comments