-
Notifications
You must be signed in to change notification settings - Fork 0
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
1 parent
b847596
commit 03dce71
Showing
12 changed files
with
142 additions
and
69 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 |
---|---|---|
|
@@ -66,3 +66,4 @@ yarn-error.log | |
/coverage | ||
/ios/Podfile.lock | ||
/yarn.lock | ||
/.env |
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,4 +1,7 @@ | ||
module.exports = { | ||
presets: ['module:@react-native/babel-preset'], | ||
plugins: ['react-native-reanimated/plugin'], | ||
plugins: [ | ||
['react-native-reanimated/plugin'], | ||
['module:react-native-dotenv'], | ||
] | ||
}; |
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
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,28 @@ | ||
import {createSlice, PayloadAction} from "@reduxjs/toolkit"; | ||
|
||
interface authState { | ||
isLoggedIn: boolean | ||
} | ||
|
||
const initialState: authState = { | ||
isLoggedIn: false | ||
} | ||
|
||
const authSlice = createSlice({ | ||
name: "auth", | ||
initialState, | ||
reducers: { | ||
logIn: (state) => { | ||
state.isLoggedIn = true | ||
}, | ||
logOut: (state) => { | ||
state.isLoggedIn = false | ||
} | ||
} | ||
}) | ||
|
||
export const { | ||
logOut, | ||
logIn | ||
} = authSlice.actions; | ||
export default authSlice.reducer; |
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 |
---|---|---|
@@ -0,0 +1,44 @@ | ||
import React from "react"; | ||
import {StyleSheet, Text, TouchableOpacity, View} from "react-native"; | ||
import {colors} from "../theme/colors.ts"; | ||
import {useDispatch} from "react-redux"; | ||
import {logOut} from "../redux/authSlice.ts"; | ||
|
||
function Account() { | ||
const dispatch = useDispatch(); | ||
return ( | ||
<View style={styles.profileContainer}> | ||
<TouchableOpacity | ||
style={{ | ||
width: '35%', | ||
height: '7%', | ||
justifyContent: 'center', | ||
alignItems: 'center', | ||
borderRadius: 12, | ||
backgroundColor: colors.primary | ||
}} | ||
onPress={() => dispatch(logOut())} | ||
> | ||
<Text | ||
style={{ | ||
color: 'white', | ||
fontSize: 17, | ||
fontWeight: '600' | ||
}} | ||
>Đăng xuất</Text> | ||
</TouchableOpacity> | ||
</View> | ||
) | ||
} | ||
|
||
const styles = StyleSheet.create({ | ||
profileContainer: { | ||
flex: 1, | ||
backgroundColor: 'white', | ||
justifyContent: 'center', | ||
alignItems: 'center' | ||
} | ||
|
||
}); | ||
|
||
export default Account; |
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 was deleted.
Oops, something went wrong.