Skip to content

Commit

Permalink
minor update
Browse files Browse the repository at this point in the history
  • Loading branch information
Monstarrrr committed Dec 22, 2024
1 parent c30d4b3 commit 298a583
Show file tree
Hide file tree
Showing 3 changed files with 80 additions and 50 deletions.
111 changes: 64 additions & 47 deletions frontend/app/(routes)/profile/page.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -178,58 +178,75 @@ export default function Profile() {
</tr>
<tr>
<td>
<b>Email:</b>
<b>Joined on:</b>
</td>
<td style={{ opacity: 0.7, fontStyle: 'italic' }}>
(coming soon...)
</td>
</tr>
<tr>
<td>
<b>Success:</b>
</td>
<td>
Prototype tester (Joined during the v0.1 of Rebutify)
</td>
{isEditingEmail ? (
<td>
<Form
id='edit-email'
inputsFields={[
{
id: 'email',
label: 'Editing email',
type: 'email',
placeholder: '[email protected]',
value: user.email,
},
]}
onSubmit={handleEditEmail}
success={editEmailSuccess}
setSuccess={setEditEmailSuccess}
loading={editEmailLoading}
inputsErrors={editEmailErrors}
>
<Button
label='Save'
success={editEmailSuccess}
loading={editEmailLoading}
/>
<Button
label='Cancel'
onClick={(_) => setIsEditingEmail(false)}
transparent
/>
</Form>
</td>
) : (
<td>
{user.email}
<Button
styles={{ marginLeft: '8px' }}
label='Edit'
onClick={handleIsEditingEmail}
transparent
/>
<p style={{ color: 'green' }}>{editEmailSuccess}</p>
</td>
)}
</tr>
</tbody>
</table>
</H2Section>

<H2>Settings</H2>
<H2Section>
<H3>
Change email
</H3>
<Hr />
<H3Section>
{isEditingEmail ? (
<>
<Form
id='edit-email'
inputsFields={[
{
id: 'email',
label: 'Editing email',
type: 'email',
placeholder: '[email protected]',
value: user.email,
},
]}
onSubmit={handleEditEmail}
success={editEmailSuccess}
setSuccess={setEditEmailSuccess}
loading={editEmailLoading}
inputsErrors={editEmailErrors}
>
<Button
label='Save'
success={editEmailSuccess}
loading={editEmailLoading}
/>
<Button
label='Cancel'
onClick={(_) => setIsEditingEmail(false)}
transparent
/>
</Form>
</>
) : (
<>
{user.email}
<Button
styles={{ marginLeft: '8px' }}
label='Edit'
onClick={handleIsEditingEmail}
transparent
/>
<p style={{ color: 'green' }}>{editEmailSuccess}</p>
</>
)}
</H3Section>
<H3>Change password</H3>
<Hr />

Expand Down Expand Up @@ -294,9 +311,9 @@ export default function Profile() {
styles={
!deleteAccSuccess
? {
background: 'red',
color: 'black',
}
background: 'red',
color: 'black',
}
: {}
}
/>
Expand Down
17 changes: 15 additions & 2 deletions frontend/app/layout.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@ export default function RootLayout({ children }: PropsType) {
padding: '12px 0',
}}
>
<span
<div
style={{
opacity: 0.7,
fontStyle: 'italic',
Expand All @@ -70,7 +70,9 @@ export default function RootLayout({ children }: PropsType) {
}}
>
<span>Rebutify, {new Date().getFullYear()}.</span>

<br />

<Link
style={LinkStyle}
href='https://docs.google.com/document/d/1YD5JONwXirWWoSGQblhfEtk968Ux9Y2Sgw0Dd9XnpuI'
Expand All @@ -89,7 +91,18 @@ export default function RootLayout({ children }: PropsType) {
<Link style={LinkStyle} href='/privacy'>
<span style={LinkLabel}>Privacy</span>
</Link>
</span>

<span
style={{
position: 'absolute',
right: '12px',
opacity: 0.7,
fontStyle: 'italic',
}}
>
Prototype (v0.1.0)
</span>
</div>
</footer>
</StoreProvider>
</body>
Expand Down
2 changes: 1 addition & 1 deletion frontend/store/slices/user.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ import { UserInfo } from '@/types'
import { createSlice } from '@reduxjs/toolkit'

const initialState: UserInfo = {
email: '',
email: '???@???.com',
id: '0',
refresh: '',
access: '',
Expand Down

0 comments on commit 298a583

Please sign in to comment.