Move next js project to archive (#207)

This commit is contained in:
Aaron Po
2026-04-20 02:30:25 -04:00
committed by GitHub
parent 92ec16ce93
commit d47e3ed7f0
347 changed files with 0 additions and 0 deletions

View File

@@ -0,0 +1,52 @@
export interface AccountPageState {
accountInfoOpen: boolean;
securityOpen: boolean;
deleteAccountOpen: boolean;
}
export type AccountPageAction =
| { type: 'TOGGLE_ACCOUNT_INFO_VISIBILITY' }
| { type: 'TOGGLE_SECURITY_VISIBILITY' }
| { type: 'TOGGLE_DELETE_ACCOUNT_VISIBILITY' }
| { type: 'CLOSE_ALL' };
const accountPageReducer = (
state: AccountPageState,
action: AccountPageAction,
): AccountPageState => {
switch (action.type) {
case 'TOGGLE_ACCOUNT_INFO_VISIBILITY': {
return {
accountInfoOpen: !state.accountInfoOpen,
securityOpen: false,
deleteAccountOpen: false,
};
}
case 'TOGGLE_DELETE_ACCOUNT_VISIBILITY': {
return {
accountInfoOpen: false,
securityOpen: false,
deleteAccountOpen: !state.deleteAccountOpen,
};
}
case 'TOGGLE_SECURITY_VISIBILITY': {
return {
accountInfoOpen: false,
securityOpen: !state.securityOpen,
deleteAccountOpen: false,
};
}
case 'CLOSE_ALL': {
return {
accountInfoOpen: false,
securityOpen: false,
deleteAccountOpen: false,
};
}
default: {
throw new Error('Invalid action type.');
}
}
};
export default accountPageReducer;