-
Notifications
You must be signed in to change notification settings - Fork 11
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #14 from MOCHI-inc-JAPAN/upmain
Upmain
- Loading branch information
Showing
7 changed files
with
250 additions
and
63 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,56 @@ | ||
import { useMemo } from 'react'; | ||
import { Stack } from './components'; | ||
import { styled } from './styles'; | ||
|
||
let measured = false; | ||
|
||
export default function PerfTest() { | ||
const start = useMemo(() => new Date(), []); | ||
|
||
return ( | ||
<Wrapper | ||
onLayout={() => { | ||
if (!measured) { | ||
measured = true; | ||
console.log( | ||
`Time taken: ${new Date().getTime() - start.getTime()} ms` | ||
); | ||
} | ||
}} | ||
> | ||
<Content> | ||
<Stack axis="y" space="4"> | ||
{Array.from({ length: 1000 }).map((_, i) => ( | ||
<Box key={i}> | ||
<BoxText>{i + 1}</BoxText> | ||
</Box> | ||
))} | ||
</Stack> | ||
</Content> | ||
</Wrapper> | ||
); | ||
} | ||
|
||
const Wrapper = styled('SafeAreaView', { | ||
flex: 1, | ||
backgroundColor: '$background', | ||
}); | ||
|
||
const Content = styled('ScrollView', { | ||
flex: 1, | ||
}).attrs((p) => ({ | ||
contentContainerStyle: { | ||
padding: p.theme.space[2], | ||
}, | ||
})); | ||
|
||
const Box = styled('View', { | ||
minHeight: 100, | ||
backgroundColor: '$primaryMuted', | ||
flexCenter: 'row', | ||
borderRadius: '$md', | ||
}); | ||
|
||
const BoxText = styled('Text', { | ||
color: '$primaryText', | ||
}); |
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 |
---|---|---|
@@ -0,0 +1,9 @@ | ||
import { styled, css } from './styles'; | ||
|
||
const View = styled('View', {}); | ||
|
||
const csstest = css({ | ||
fontSize: 16, | ||
}); | ||
|
||
export const Test = <View css={csstest} />; |
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