Skip to content

Commit

Permalink
Add cosmetic improvement
Browse files Browse the repository at this point in the history
  • Loading branch information
ubbn committed May 17, 2024
1 parent b8a155e commit a9b0561
Show file tree
Hide file tree
Showing 15 changed files with 21 additions and 17 deletions.
2 changes: 1 addition & 1 deletion frontend/public/icon.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
2 changes: 1 addition & 1 deletion frontend/src/common/editor/images/icons/chevron-down.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
2 changes: 1 addition & 1 deletion frontend/src/common/editor/images/icons/journal-code.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
2 changes: 1 addition & 1 deletion frontend/src/common/editor/images/icons/justify.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
2 changes: 1 addition & 1 deletion frontend/src/common/editor/images/icons/list-ol.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
2 changes: 1 addition & 1 deletion frontend/src/common/editor/images/icons/list-ul.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
2 changes: 1 addition & 1 deletion frontend/src/common/editor/images/icons/text-center.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
2 changes: 1 addition & 1 deletion frontend/src/common/editor/images/icons/text-left.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
2 changes: 1 addition & 1 deletion frontend/src/common/editor/images/icons/text-paragraph.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
2 changes: 1 addition & 1 deletion frontend/src/common/editor/images/icons/text-right.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
2 changes: 1 addition & 1 deletion frontend/src/components/layout/body.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ const Container = styled.div`
min-height: 80vh;
display: flex;
max-width: 1098px;
@media (max-width: 600px) {
@media (max-width: 1200px) {
margin: 20px 10px;
}
`;
Expand Down
7 changes: 4 additions & 3 deletions frontend/src/components/neuron/ModalStudy.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ import styled from "styled-components";
import { FlexRow } from "../../common";
import Editor from "../../common/editor/editor";
import { RootState } from "../../redux/store";
import { getDateFromStr } from "./utils";
import { getDateFromStr, getGoodFormatted } from "./utils";

const sizeOptions = [
{ label: "S", value: 700 },
Expand Down Expand Up @@ -60,7 +60,6 @@ const StudyModal = ({
const score = getScore(neurons[index]);
setRate(score)
setItem(neurons[index])
setPreview(false)
setPristine(true)
}, [index])

Expand Down Expand Up @@ -159,10 +158,12 @@ const StudyModal = ({
};

const onPrevious = () => {
setPreview(false)
executeIfPristine(() => setIndex(index === 0 ? neurons.length - 1 : index - 1));
}

const onNext = () => {
setPreview(false)
executeIfPristine(() => setIndex(index >= neurons.length - 1 ? 0 : index + 1));
}

Expand Down Expand Up @@ -190,7 +191,7 @@ const StudyModal = ({
<Button onClick={onNext}>{">"}</Button>
</div>
)}
<StudyHeader>
<StudyHeader title={getGoodFormatted(neurons[index]?.created)}>
<span className="non-mobile">Study on </span><strong>Day {getThatFuckingDay(item)}</strong>
</StudyHeader>
<div>
Expand Down
5 changes: 4 additions & 1 deletion frontend/src/components/neuron/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -88,7 +88,10 @@ const Ilearn = () => {
};

const onSave = (neuron: Neuron) => {
dispatch(thunkUpdateNeuron(neuron));
if (showEditModal) {
// Only set if it is edit modal
dispatch(thunkUpdateNeuron(neuron));
}
setStudyList(studyList.map((v) => (v.id === neuron.id ? neuron : v)));
setHasChanged(true);
openNotification(neuron);
Expand Down

0 comments on commit a9b0561

Please sign in to comment.