Skip to content

Commit

Permalink
Frontend Refactorings & Fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
R1c4rdCo5t4 committed May 24, 2024
1 parent 0628088 commit ad3d91c
Show file tree
Hide file tree
Showing 17 changed files with 247 additions and 190 deletions.
8 changes: 8 additions & 0 deletions code/client/src/App.scss
Original file line number Diff line number Diff line change
Expand Up @@ -44,3 +44,11 @@
}
}
}

.editable-text {
background-color: transparent;
color: black;
border: 1px black;
font-size: 16px;
font-weight: 500;
}
13 changes: 0 additions & 13 deletions code/client/src/index.css
Original file line number Diff line number Diff line change
Expand Up @@ -60,19 +60,6 @@ button {
background-color: rgba(0, 0, 0, 0.05) !important;
}

@media (prefers-color-scheme: light) {
:root {
color: #213547;
background-color: #ffffff;
}
a:hover {
color: #747bff;
}
button {
background-color: #f9f9f9;
}
}

::selection {
background-color: grey;
color: white;
Expand Down
114 changes: 0 additions & 114 deletions code/client/src/ui/components/sidebar/Sidebar.scss
Original file line number Diff line number Diff line change
Expand Up @@ -67,118 +67,4 @@
align-items: center;
gap: 10px;
}

.workspace-tree {
ul {
padding: 0;
li {
padding: 1px;
}
}

.popup {
position: fixed;
background: black;
color: white;
border-radius: 15px;
margin-left: 20px;
display: flex;
flex-direction: column;
justify-content: start;
align-items: start;

button {
display: flex;
flex-direction: row;
justify-content: start;
align-items: center;
gap: 10px;
width: 100%;
border-radius: 15px;
}

button:hover {
color: white;
background-color: rgb(255, 255, 255, 0.1);
}
}
}

.resource {
display: flex;
flex-direction: column;
width: 100%;

.resource-header {
display: flex;
flex-direction: row;
justify-content: space-between;
align-items: center;
transition: 0.1s;
width: 90%;
border-radius: 5px;

:first-child {
display: flex;
flex-direction: row;
justify-content: center;
align-items: center;
}

div {
display: flex;
flex-direction: row;
justify-content: start;
border-radius: 5px;
user-select: none;
}
}

.resource-header:hover {
background-color: rgba(0, 0, 0, 0.1);
cursor: pointer;
}

.resource-header > button {
display: none;
}

.resource-header:hover > button {
display: block;
}

.resource-header > button:hover {
color: gray;
}

.resource-header > div {
white-space: nowrap;
overflow-x: hidden;
text-overflow: ellipsis;
max-width: max-content;
}

.resource-children {
padding-left: 10px;
}

.resource-name {
display: flex;
flex-direction: row;
justify-content: center;
align-items: center;
gap: 2px;
}

.folder svg {
color: darkgray;
}

button {
background-color: transparent;
color: black;
padding: 5px;
margin: 0;
}
}
}
2 changes: 1 addition & 1 deletion code/client/src/ui/components/sidebar/Sidebar.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ import { RiMenuFold2Line, RiMenuFoldLine, RiTeamFill } from 'react-icons/ri';
import useWorkspace from '@ui/contexts/workspace/useWorkspace';
import useSidebarState from '@ui/components/sidebar/hooks/useSidebarState';
import './Sidebar.scss';
import WorkspaceTree from '@ui/components/sidebar/components/WorkspaceTree';
import WorkspaceTree from '@ui/components/sidebar/components/workspace-tree/WorkspaceTree';
import { IoMdSettings } from 'react-icons/io';
import { TiHome } from 'react-icons/ti';

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -36,13 +36,13 @@ function TreeResourceView({ resource, workspace, children, onCreateResource, onD
<div className="resource">
<div className="resource-header">
<div>
<div>
<>
{resource.children.length > 0 ? (
<button onClick={handleToggle}>{isOpen ? <RiArrowDownSFill /> : <RiArrowRightSFill />}</button>
) : (
<PiDotOutlineFill />
)}
</div>
</>

<CreateResourceContextMenu
onCreateNew={(type: ResourceType) => onCreateResource!(resource.id, type)}
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,117 @@
.workspace-tree {
ul {
padding: 0;
li {
padding: 1px;
}
}

.popup {
position: fixed;
background: black;
color: white;
border-radius: 15px;
margin-left: 20px;
display: flex;
flex-direction: column;
justify-content: start;
align-items: start;

button {
display: flex;
flex-direction: row;
justify-content: start;
align-items: center;
gap: 10px;
width: 100%;
border-radius: 15px;
}

button:hover {
color: white;
background-color: rgb(255, 255, 255, 0.1);
}
}

.resource {
display: flex;
flex-direction: column;
width: 100%;

.resource-header {
display: flex;
flex-direction: row;
justify-content: space-between;
align-items: center;
transition: 0.1s;
width: 90%;
border-radius: 5px;

:first-child {
display: flex;
flex-direction: row;
justify-content: center;
align-items: center;
}

div {
display: flex;
flex-direction: row;
justify-content: start;
border-radius: 5px;
user-select: none;
}
}

.resource-header:hover {
background-color: rgba(0, 0, 0, 0.1);
cursor: pointer;
}

.resource-header > button {
display: none;
}

.resource-header:hover > button {
display: block;
}

.resource-header > button:hover {
color: gray;
}

.resource-header > div {
white-space: nowrap;
overflow-x: hidden;
text-overflow: ellipsis;
max-width: max-content;

button {
padding: 0;
}
}

.resource-children {
padding-left: 10px;
}

.resource-name {
display: flex;
flex-direction: row;
justify-content: center;
align-items: center;
gap: 2px;
}

.folder svg {
color: darkgray;
}

button {
background-color: transparent;
color: black;
padding: 5px;
margin: 0;
}
}
}
Original file line number Diff line number Diff line change
@@ -1,9 +1,10 @@
import TreeResourceView from '@ui/components/sidebar/components/TreeResourceView';
import TreeResourceView from '@ui/components/sidebar/components/workspace-tree/TreeResourceView';
import { WorkspaceMeta } from '@notespace/shared/src/workspace/types/workspace';
import { getTree } from '@domain/workspaces/tree/utils';
import { ResourceType } from '@notespace/shared/src/workspace/types/resource';
import { DragEvent, useState } from 'react';
import { Resources, WorkspaceOperations } from '@ui/contexts/workspace/WorkspaceContext';
import './WorkspaceTree.scss';

type WorkspaceTreeProps = {
workspace: WorkspaceMeta;
Expand Down
25 changes: 20 additions & 5 deletions code/client/src/ui/components/table/DataTable.scss
Original file line number Diff line number Diff line change
Expand Up @@ -18,15 +18,25 @@
color: white;
}

.table-header button {
padding: 0;
margin: 0;
.table-header {
grid-template-rows: 4vh !important;

button {
padding: 0;
margin: 0;
font-weight: 500;

svg {
font-size: 3vh;
margin-left: -3vh;
}
}
}

.table-row,
.table-header {
display: grid;
grid-template-columns: 50px repeat(4, 1fr);
grid-template-columns: 50px repeat(auto-fit, minmax(100px, 1fr));
grid-template-rows: 5vh;
row-gap: 10vh;
grid-gap: 1vh;
Expand All @@ -38,9 +48,14 @@
background-color: lightgray;
border-radius: 5px;
transition: background-color 0.2s;
white-space: nowrap;

span {
width: min-content;
width: 100%;
display: inline-block;
text-overflow: ellipsis;
white-space: nowrap;
overflow: hidden;
}
}

Expand Down
Loading

0 comments on commit ad3d91c

Please sign in to comment.