-
Notifications
You must be signed in to change notification settings - Fork 0
Step 0: Measurement code #6
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 our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Conversation
@@ -15,7 +15,7 @@ export const BottomTabNavigator = () => { | |||
|
|||
return ( | |||
<Tab.Navigator | |||
initialRouteName="Welcome" | |||
initialRouteName="Exhibitions" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pls change the initial route also for the main
branch
name="Welcome" | ||
component={Welcome} | ||
name="About" | ||
component={About} | ||
options={() => ({header: Noop})} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
What's the story with header: Noop
?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Literaly just didn't wanna have the inline () => null
so I made this Noop placeholder. Happy to change that if you think it's unclear or looks weird
src/screens/About/About.tsx
Outdated
const isDarkMode = currentMode === 'dark'; | ||
|
||
const backgroundStyle = { | ||
backgroundColor: Colors[currentMode || defaultColorMode], |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Colors
object with just single key looks a bit weird; could these be like:
const lightTheme: Colors {
text: "#fff",
background: "#fff",
}
const darkTheme: Colors {
text: "#fff",
background: "#fff",
}
export const colors = {
light: lightTheme,
dark: darkTheme,
} as const;
src/screens/About/About.tsx
Outdated
import { measure } from '~utils/measure'; | ||
import {Container, Header, Paragraph, SubHeader} from './About.styled'; | ||
|
||
type Props = {}; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Screens typically do not have props.
src/screens/About/About.tsx
Outdated
|
||
return ( | ||
<React.Profiler id="Tab:About" onRender={measure.onRender}> | ||
<SafeAreaView style={backgroundStyle}> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Lets put this About
screen, without React.Profiler
also to main
, so that we only add Profiler here
.
BTW how about creating withProfiler
HOC for step ze that would simply wrap the component, it would not cause reformats.
//... as is
});
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'll see if I can get the HOC in :)
src/screens/About/About.tsx
Outdated
backgroundColor={backgroundStyle.backgroundColor} | ||
/> | ||
<Container> | ||
<Header color={isDarkMode ? Colors.light : Colors.dark}> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Could we make dark mode in the following way everywhere
<Header color={isDarkMode ? Colors.light : Colors.dark}> | |
<Header color={colors[currentMode].text}> |
(this chage is for main
)
src/screens/Artworks/Artworks.tsx
Outdated
@@ -28,49 +29,51 @@ export const Artworks = ({}: Props) => { | |||
const backgroundStyle = { | |||
backgroundColor: Colors[currentMode || defaultColorMode], | |||
}; | |||
const queryOptions = {limit: '15'}; | |||
const queryOptions = {limit: '50'}; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
move also to main
const currentMode = useColorScheme(); | ||
const isDarkMode = currentMode === 'dark'; | ||
|
||
const getTimerLabel = () => { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
const getTimerLabel = () => { | |
const formatTimeLeft = () => { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
🚀
|
||
React.useEffect(() => { | ||
timer.current = setInterval(() => setTimerLabel(getTimerLabel()), 1000); | ||
}, [getTimerLabel]); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
return () => clearInterval(timer.current)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
<3
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good. Kuba pls move all of the code, except adding Measure tools and React.Profiler
also to main
branch. I plan to have step 0 just to add measuring code.
All other changes, like page size, tab order, etc should be moved to main
195801f
to
f7c70b7
Compare
Updated based on comments and rebased with current state of the |
3fedc27
to
c90e705
Compare
c90e705
to
1e4db4c
Compare
826aa56
to
cdf973e
Compare
…shops-example into step-0_measurementc-code
Uh oh!
There was an error while loading. Please reload this page.