Skip to content

Commit

Permalink
Tiny bug fixes (#55)
Browse files Browse the repository at this point in the history
* do not show modal a hundred times

* make colors a little better (worse?)
  • Loading branch information
arvid220u authored Jul 28, 2022
1 parent eb60a81 commit 2067a05
Show file tree
Hide file tree
Showing 4 changed files with 16 additions and 4 deletions.
13 changes: 12 additions & 1 deletion gui/src/renderer/Main.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -69,6 +69,7 @@ function Main({
updateTab,
] = useTabs(defaultTabs);
const [modal, setModal] = React.useState<JSX.Element | null>(null);
const [hasShownInitialModal, setHasShownInitialModal] = React.useState(false);

const statusState = React.useContext(statusContext);

Expand Down Expand Up @@ -135,6 +136,9 @@ function Main({
}, [setModal]);

React.useEffect(() => {
if (hasShownInitialModal) {
return;
}
if (initialModal === InitialModal.AddFriendByPublicId) {
setModal(
<AddFriend
Expand All @@ -148,7 +152,14 @@ function Main({
/>
);
}
}, [closeModal, statusState, initialModal, initialModalData]);
setHasShownInitialModal(true);
}, [
closeModal,
statusState,
initialModal,
initialModalData,
hasShownInitialModal,
]);

const openFriendModal = React.useCallback(() => {
setModal(
Expand Down
4 changes: 2 additions & 2 deletions gui/src/renderer/components/Invitations.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ function OutgoingAsyncInvitationComp({
return (
<div
className={`${
active ? "border-asbrown-100 bg-asbeige" : "border-white bg-white"
active ? "border-asbrown-100 bg-asbeige2" : "border-white bg-white"
} my-2 rounded-sm border-l-4 px-4 py-4`}
>
<div className="flex flex-row gap-5">
Expand Down Expand Up @@ -113,7 +113,7 @@ function IncomingInvitationComp({
return (
<div
className={`${
active ? "border-asbrown-100 bg-asbeige" : "border-white bg-white"
active ? "border-asbrown-100 bg-asbeige2" : "border-white bg-white"
} my-2 rounded-sm border-l-4 px-4 py-4`}
>
<div className="flex flex-row gap-5">
Expand Down
2 changes: 1 addition & 1 deletion gui/src/renderer/components/MessageList.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ function IncomingMessageBlurb({
return (
<div
className={`${
active ? "border-asbrown-100 bg-asbeige" : "border-white bg-white"
active ? "border-asbrown-100 bg-asbeige2" : "border-white bg-white"
} my-2 rounded-sm border-l-4 px-4 py-4`}
>
<div className="flex flex-row gap-5">
Expand Down
1 change: 1 addition & 0 deletions gui/tailwind.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,7 @@ module.exports = {
dark: "#194F39",
},
asbeige: "#F9F7F1",
asbeige2: "#FCFBF8",
asyellow: {
light: "#FECA6F",
500: "#E2A924",
Expand Down

0 comments on commit 2067a05

Please sign in to comment.