added orai
This commit is contained in:
26
20250312/my-app/app/components/CounterSlice.ts
Normal file
26
20250312/my-app/app/components/CounterSlice.ts
Normal file
@@ -0,0 +1,26 @@
|
||||
import {createSlice} from "@reduxjs/toolkit";
|
||||
|
||||
interface CounterState {
|
||||
value: number;
|
||||
}
|
||||
|
||||
const initialState: CounterState = {
|
||||
value: 0,
|
||||
};
|
||||
|
||||
const counterSlice = createSlice({
|
||||
name: "counter",
|
||||
initialState,
|
||||
reducers: {
|
||||
increment: (state) => {
|
||||
state.value += 1;
|
||||
},
|
||||
|
||||
decrement: (state) => {
|
||||
state.value -= 1;
|
||||
},
|
||||
},
|
||||
});
|
||||
|
||||
export const {increment, decrement} = counterSlice.actions;
|
||||
export default counterSlice.reducer;
|
||||
30
20250312/my-app/app/components/Styles.tsx
Normal file
30
20250312/my-app/app/components/Styles.tsx
Normal file
@@ -0,0 +1,30 @@
|
||||
import {StyleSheet} from 'react-native';
|
||||
|
||||
const styles = StyleSheet.create({
|
||||
container: {
|
||||
flex: 1,
|
||||
padding: 20,
|
||||
alignItems: 'center',
|
||||
justifyContent: 'center',
|
||||
},
|
||||
title:{
|
||||
fontSize: 24,
|
||||
fontWeight: "bold",
|
||||
marginBottom: 20,
|
||||
},
|
||||
input: {
|
||||
width: "80%",
|
||||
borderWidth: 1,
|
||||
borderColor: "#ccc",
|
||||
padding: 10,
|
||||
marginBottom: 20,
|
||||
borderRadius: 5,
|
||||
backgroundColor: "#ff00ff"
|
||||
},
|
||||
text: {
|
||||
fontSize: 18,
|
||||
marginBottom: 20,
|
||||
},
|
||||
});
|
||||
|
||||
export default styles;
|
||||
Reference in New Issue
Block a user