-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
10 changed files
with
171 additions
and
23 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,22 @@ | ||
name: Pull Request Trigger Workflow | ||
|
||
on: | ||
pull_request: | ||
branches: | ||
- develop | ||
|
||
jobs: | ||
build-and-test: | ||
runs-on: windows-latest | ||
|
||
steps: | ||
- uses: actions/checkout@v4 | ||
- name: Setup Node.js | ||
uses: actions/setup-node@v3 | ||
with: | ||
node-version: '>=18' | ||
- name: Install dependencies | ||
run: npm install | ||
- name: Run tests | ||
run: npm run test -- --ci | ||
|
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,19 @@ | ||
name: Push Trigger Workflow | ||
|
||
on: | ||
push: | ||
|
||
jobs: | ||
build: | ||
runs-on: windows-latest | ||
|
||
steps: | ||
- uses: actions/checkout@v4 | ||
- name: Setup Node.js | ||
uses: actions/setup-node@v3 | ||
with: | ||
node-version: '>=18' | ||
- name: Install dependencies | ||
run: npm install | ||
- name: Run tests | ||
run: npm run test -- --ci |
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
18 changes: 18 additions & 0 deletions
18
components/__tests__/__snapshots__/StyledText-test.js.snap
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,18 @@ | ||
// Jest Snapshot v1, https://goo.gl/fbAQLP | ||
|
||
exports[`renders correctly 1`] = ` | ||
<Text | ||
style={ | ||
[ | ||
{ | ||
"color": "#000", | ||
}, | ||
[ | ||
undefined, | ||
], | ||
] | ||
} | ||
> | ||
Snapshot test! | ||
</Text> | ||
`; |
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 @@ | ||
export type ThemeType = "light" | "dark" | null |
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,33 @@ | ||
import { ThemeType } from "@/constants/Types"; | ||
import React, { createContext, useState } from "react"; | ||
import * as SecureStore from "expo-secure-store"; | ||
|
||
interface ContextType { | ||
theme: ThemeType; | ||
changeTheme: (theme: "light" | "dark") => void; | ||
} | ||
|
||
export const ThemeContext = createContext<ContextType>({ | ||
theme: null, | ||
changeTheme: (theme: "light" | "dark") => {}, | ||
}); | ||
|
||
interface Props { | ||
children: React.JSX.Element | React.JSX.Element[]; | ||
theme: ThemeType; | ||
} | ||
|
||
export default function ThemeProvider({ children, theme: value }: Props) { | ||
const [theme, setTheme] = useState<ThemeType>(value); | ||
|
||
async function changeTheme(theme: "light" | "dark") { | ||
setTheme(theme); | ||
await SecureStore.setItemAsync("theme", theme!); | ||
} | ||
|
||
return ( | ||
<ThemeContext.Provider value={{ theme: theme, changeTheme: changeTheme }}> | ||
{children} | ||
</ThemeContext.Provider> | ||
); | ||
} |
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
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