Skip to content

Commit 7b9e082

Browse files
committed
update
1 parent d5952b4 commit 7b9e082

File tree

11 files changed

+46
-28
lines changed

11 files changed

+46
-28
lines changed

src/App.jsx

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -225,7 +225,9 @@ const darkTheme = createTheme({
225225
});
226226

227227
const App = () => {
228-
const { loading, currentUser, error, selectedTheme } = useSelector((state) => state.auth);
228+
const { loading, currentUser, error, selectedTheme } = useSelector(
229+
(state) => state.auth
230+
);
229231
const [currentAuthUser, setCurrentAuthUser] = useState(currentUser);
230232
const [currentLanguage, setCurrentLanguage] = useState(null);
231233
const [currentTheme, setCurrentTheme] = useState(selectedTheme);

src/components/AppHeader/index.jsx

Lines changed: 8 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -15,10 +15,7 @@ import {
1515
setFilterType,
1616
toggleSidebarCollapsed,
1717
} from "@app/store/mailAppReducer/actions";
18-
import {
19-
uploadPicture,
20-
userLogout
21-
} from "@app/store/authReducer/actions";
18+
import { uploadPicture, userLogout } from "@app/store/authReducer/actions";
2219
import { useTheme } from "@mui/material/styles";
2320

2421
import AppBar from "@mui/material/AppBar";
@@ -115,6 +112,7 @@ const AppHeader = ({ viewMode, handleViewModeChange }) => {
115112

116113
const handleEditClose = () => {
117114
setEdit(false);
115+
setAnchorElUser(null);
118116
};
119117
const handleUserMenuClick = (index) => {
120118
switch (index) {
@@ -125,7 +123,7 @@ const AppHeader = ({ viewMode, handleViewModeChange }) => {
125123
setEdit(true);
126124
break;
127125
case 2:
128-
dispatch(userLogout())
126+
dispatch(userLogout());
129127
break;
130128
default:
131129
break;
@@ -252,7 +250,10 @@ const AppHeader = ({ viewMode, handleViewModeChange }) => {
252250
<Box sx={{ flexGrow: 0 }}>
253251
<Tooltip title="Open settings">
254252
<IconButton onClick={handleOpenUserMenu} sx={{ ml: 7 }}>
255-
<CustomAvatar alt="user name" src={currentAuthUser?.profile_picture} />
253+
<CustomAvatar
254+
alt="user name"
255+
src={currentAuthUser?.profile_picture}
256+
/>
256257
</IconButton>
257258
</Tooltip>
258259
<Menu
@@ -349,7 +350,7 @@ const AppHeader = ({ viewMode, handleViewModeChange }) => {
349350
</Popover>
350351
</Box>
351352
</Box>
352-
<EditInfo open={edit} onCloseDialog={handleEditClose} />
353+
<EditInfo open={edit} onCloseDialog={handleEditClose} />
353354
</Box>
354355
);
355356
};

src/components/EditInfo/index.jsx

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,8 @@ const EditInfo = ({ open, onCloseDialog }) => {
4141

4242
const onSubmit = (event) => {
4343
event.preventDefault();
44-
const { firstName, lastName, bio, programmingLanguage } = personalInfoValues;
44+
const { firstName, lastName, bio, programmingLanguage } =
45+
personalInfoValues;
4546

4647
if (!firstName) {
4748
setErrorValues({
@@ -67,7 +68,7 @@ const EditInfo = ({ open, onCloseDialog }) => {
6768
dispatch(
6869
SetPersonalInfo({ firstName, lastName, bio, programmingLanguage })
6970
);
70-
onCloseDialog()
71+
onCloseDialog();
7172
}
7273
};
7374

@@ -253,7 +254,10 @@ const EditInfo = ({ open, onCloseDialog }) => {
253254
...personalInfoValues,
254255
programmingLanguage: e.target.value,
255256
});
256-
setErrorValues({ ...errorValues, programmingLanguageError: "" });
257+
setErrorValues({
258+
...errorValues,
259+
programmingLanguageError: "",
260+
});
257261
}}
258262
require
259263
>

src/components/Features/index.jsx

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -216,7 +216,11 @@ const Features = () => {
216216
}}
217217
>
218218
<Box>
219-
<img src="/features.png" alt="Code Inbox Features" height="800px" />
219+
<img
220+
src="/features.png"
221+
alt="Code Inbox Features"
222+
height="800px"
223+
/>
220224
</Box>
221225
</Grid>
222226
<Grid item xs={12} md={6} lg={4}>

src/components/Header/index.jsx

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -51,12 +51,12 @@ function Header(props) {
5151

5252
const navigate = useNavigate();
5353
const theme = useTheme();
54-
const dispatch = useDispatch()
55-
54+
const dispatch = useDispatch();
55+
5656
const toggleDarkTheme = () => {
5757
const newTheme = darkTheme ? "light" : "dark";
5858
setDarkTheme(newTheme === "dark");
59-
dispatch(toggleTheme(newTheme))
59+
dispatch(toggleTheme(newTheme));
6060
};
6161

6262
const handleLogInClick = (event) => {

src/components/MailDetail/MailReply.jsx

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -76,9 +76,7 @@ const MailReply = ({
7676
}}
7777
component="p"
7878
dangerouslySetInnerHTML={{
79-
__html: cleanEmailBody(
80-
reply.message
81-
),
79+
__html: cleanEmailBody(reply.message),
8280
}}
8381
/>
8482
)}

src/components/MailDetail/ReplyMailForm.jsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -42,8 +42,8 @@ const ReplyMailForm = ({ threadId, onClickReplyMail }) => {
4242
const onClickSend = () => {
4343
if (message || attachments.length > 0) {
4444
const mail = {
45-
"thread_id": threadId,
46-
"body": message,
45+
thread_id: threadId,
46+
body: message,
4747
};
4848
onClickReplyMail(mail);
4949
setAttachments([]);

src/components/MailDetail/index.jsx

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -195,7 +195,10 @@ const MailDetail = ({ width, onClickForwardMail }) => {
195195
))}
196196
</Box>
197197

198-
<ReplyMailForm threadId={selectedMail.thread_id} onClickReplyMail={onClickReplyMail} />
198+
<ReplyMailForm
199+
threadId={selectedMail.thread_id}
200+
onClickReplyMail={onClickReplyMail}
201+
/>
199202
</Box>
200203
</PerfectScrollbar>
201204
</>

src/store/authReducer/actions/index.js

Lines changed: 10 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -82,7 +82,7 @@ export const userLogout = createAsyncThunk(
8282
};
8383
const response = await axios.post(
8484
`${baseURL}/user/logout`,
85-
{token: localStorage.getItem("token")},
85+
{ token: localStorage.getItem("token") },
8686
config
8787
);
8888
return response.data;
@@ -96,10 +96,12 @@ export const userLogout = createAsyncThunk(
9696
}
9797
);
9898

99-
10099
export const SetPersonalInfo = createAsyncThunk(
101100
"user/profile",
102-
async ({ firstName, lastName, bio, programmingLanguage }, { rejectWithValue }) => {
101+
async (
102+
{ firstName, lastName, bio, programmingLanguage },
103+
{ rejectWithValue }
104+
) => {
103105
try {
104106
const config = {
105107
headers: {
@@ -110,7 +112,11 @@ export const SetPersonalInfo = createAsyncThunk(
110112
};
111113
const response = await axios.put(
112114
`${baseURL}/user/profile`,
113-
{ full_name: `${firstName} ${lastName}`, bio: bio, programming_language: programmingLanguage },
115+
{
116+
full_name: `${firstName} ${lastName}`,
117+
bio: bio,
118+
programming_language: programmingLanguage,
119+
},
114120
config
115121
);
116122
return response.data;

src/store/authReducer/index.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -78,9 +78,9 @@ const authReducer = createSlice({
7878
state.loading = false;
7979
state.success = true;
8080
// TODO: fix this
81-
state.currentUser = JSON.parse(localStorage.getItem("user"))
81+
state.currentUser = JSON.parse(localStorage.getItem("user"));
8282
state.currentUser.profile_picture = action.payload.image;
83-
localStorage.setItem("user", JSON.stringify(state.currentUser))
83+
localStorage.setItem("user", JSON.stringify(state.currentUser));
8484
// state.message = action.payload.message;
8585
});
8686
builder.addCase(uploadPicture.rejected, (state, action) => {

0 commit comments

Comments
 (0)