Skip to content

Commit

Permalink
fix: Fixed flickering in the dark mode.
Browse files Browse the repository at this point in the history
  • Loading branch information
philipp-meier committed Jul 5, 2024
1 parent afd82a8 commit 689d1b5
Show file tree
Hide file tree
Showing 6 changed files with 18 additions and 14 deletions.
4 changes: 2 additions & 2 deletions src/Chrono/ClientApp/src/Features/Notes/NoteEditControl.tsx
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import {useEffect, useState} from "react";
import {useNavigate} from "react-router-dom";
import {Link, useNavigate} from "react-router-dom";
import {Button, Confirm, Container, Dropdown, Form, Icon, Input} from "semantic-ui-react";
import {Note} from "../../Entities/Note";

Expand Down Expand Up @@ -146,7 +146,7 @@ const NoteEditControl = (props: {
</Button.Group>
</Form.Field>
<Form.Field>
<Button as="a" href="/notes">
<Button as={Link} to="/notes">
<Icon name="list ul"/>
Back to the list
</Button>
Expand Down
7 changes: 4 additions & 3 deletions src/Chrono/ClientApp/src/Features/Notes/NotePage.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ import {useEffect, useState} from "react";
import {Button, Card, Container, Icon} from "semantic-ui-react";
import {useMediaQuery} from "react-responsive";
import {GetMyNotesResponse, NotePreview} from "../../Entities/Note";
import {Link} from "react-router-dom";

// Shared
import NoItemsMessage from "../../Shared/Components/NoItemsMessage";
Expand Down Expand Up @@ -52,7 +53,7 @@ const NotePage = () => {
<Card key={n.id}>
<Card.Content>
<Card.Header className="note-header">
<a href={`/notes/${n.id}`}>{n.title}</a>
<Link to={`/notes/${n.id}`}>{n.title}</Link>
<Icon name="map pin" color={n.isPinned ? "blue" : "grey"} size="small" title={n.isPinned ? "Unpin" : "Pin"}
onClick={() => togglePinned(n)}/>
</Card.Header>
Expand All @@ -74,8 +75,8 @@ const NotePage = () => {
>
<div className="buttons">
<Button
as="a"
href={`/notes/add`}
as={Link}
to={`/notes/add`}
circular={isMobileOptimized}
size={isMobileOptimized ? "huge" : undefined}
icon={isMobileOptimized}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ import SyntaxHighlighter from "react-syntax-highlighter"
import {dracula} from 'react-syntax-highlighter/dist/esm/styles/hljs';
import {Task} from "../../Entities/Task";
import {Category} from "../../Entities/Category";
import {Link} from "react-router-dom";

// Shared
import IconLabel from "../../Shared/Components/IconLabel";
Expand All @@ -31,13 +32,13 @@ const TaskItemViewControl = (props: { task: Task; moveUp?: any; moveDown?: any }
<IconLabel
text={(!isMobileOptimized ? "No.: " : "#") + props.task.position}
/>
<a
href={`/lists/${props.task.listId}/tasks/${props.task.id}`}
<Link
to={`/lists/${props.task.listId}/tasks/${props.task.id}`}
className="task-name"
style={{marginLeft: "0.25em"}}
>
{props.task.name}
</a>
</Link>
</Container>
{!props.task.done && (
<Container className="actions" textAlign="right">
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ import type {Task} from "../../Entities/Task";
import type {TaskList, TaskListBrief} from "../../Entities/TaskList";
import type {Category} from "../../Entities/Category";
import {UserSettings} from "../../Entities/User";
import {Link} from "react-router-dom";

// Shared
import NoItemsMessage from "../../Shared/Components/NoItemsMessage";
Expand Down Expand Up @@ -170,8 +171,8 @@ const TaskListEditControl = (props: { taskListId: number }) => {
</div>
<div className="buttons">
<Button
as="a"
href={`/lists/${taskList?.id}/tasks/add`}
as={Link}
to={`/lists/${taskList?.id}/tasks/add`}
circular={isMobileOptimized}
size={isMobileOptimized ? "huge" : undefined}
icon={isMobileOptimized}
Expand Down
4 changes: 2 additions & 2 deletions src/Chrono/ClientApp/src/Features/Tasks/TaskEditControl.tsx
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import "./TaskEditControl.less";
import {useEffect, useState} from "react";
import {useNavigate} from "react-router-dom";
import {Link, useNavigate} from "react-router-dom";
import {Button, Confirm, Container, Dropdown, Form, Icon, Input} from "semantic-ui-react";
import TaskCategoryEditControl from "./TaskCategoryEditControl";
import {Task} from "../../Entities/Task";
Expand Down Expand Up @@ -240,7 +240,7 @@ const TaskEditControl = (props: {
</Form.Field>
)}
<Form.Field>
<Button as="a" href={`/lists/${props.listId}`}>
<Button as={Link} to={`/lists/${props.listId}`}>
<Icon name="list ul"/>
Back to the list
</Button>
Expand Down
5 changes: 3 additions & 2 deletions src/Chrono/ClientApp/src/Shared/Components/NoItemsMessage.tsx
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
import {Button, Header, Icon, Segment} from "semantic-ui-react";
import {Link} from "react-router-dom";

type NoItemsMessageButton = {
text: string;
Expand All @@ -18,8 +19,8 @@ const NoItemsMessage = (props: {
{props.buttonOptions &&
<Button
primary
as="a"
href={props.buttonOptions.href}>
as={Link}
to={props.buttonOptions.href}>
{props.buttonOptions.text}
</Button>
}
Expand Down

0 comments on commit 689d1b5

Please sign in to comment.