Skip to content

Commit 4cea23b

Browse files
Merge pull request #48 from Your-Ehsan/47-change-name-from-notebook-to-treo-some-other-required-changes-to-finalize-the-application
refactor(ui): all unnecessary ui removed
2 parents eae5035 + ab3e3ec commit 4cea23b

File tree

17 files changed

+165
-546
lines changed

17 files changed

+165
-546
lines changed

.vscode/settings.json

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,5 +7,9 @@
77
},
88
"[json]": {
99
"editor.defaultFormatter": "esbenp.prettier-vscode"
10-
}
10+
},
11+
"cSpell.words": [
12+
"treo",
13+
"unnesaccary"
14+
]
1115
}

electron-builder.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
appId: com.electron.app
2-
productName: Notebook
2+
productName: Treo
33
directories:
44
buildResources: build
55
files:
@@ -12,7 +12,7 @@ files:
1212
asarUnpack:
1313
- resources/**
1414
win:
15-
executableName: Notebook
15+
executableName: Treo
1616
nsis:
1717
artifactName: ${name}-${version}-setup.${ext}
1818
shortcutName: ${productName}

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
{
2-
"name": "notebook",
2+
"name": "treo",
33
"version": "1.1.4",
44
"description": "An Electron application with React and TypeScript",
55
"main": "./out/main/index.js",

src/renderer/index.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
<html>
33
<head>
44
<meta charset="UTF-8" />
5-
<title>Notebook</title>
5+
<title>Treo</title>
66
<!-- https://developer.mozilla.org/en-US/docs/Web/HTTP/CSP -->
77
<meta
88
http-equiv="Content-Security-Policy"

src/renderer/src/components/app-sidebar.tsx

Lines changed: 8 additions & 124 deletions
Original file line numberDiff line numberDiff line change
@@ -1,112 +1,36 @@
1-
import {
2-
AudioWaveform,
3-
BookOpen,
4-
Bot,
5-
Command,
6-
Frame,
7-
GalleryVerticalEnd,
8-
Map,
9-
PieChart,
10-
Settings2,
11-
SquareTerminal
12-
} from 'lucide-react'
13-
import {
14-
Sidebar,
15-
SidebarContent,
16-
SidebarFooter,
17-
SidebarHeader,
18-
SidebarRail,
19-
useSidebar
20-
} from './ui/sidebar'
1+
import { NotebookTabsIcon, Settings2, TextSelectIcon } from 'lucide-react'
2+
import { Sidebar, SidebarContent, SidebarHeader, SidebarRail, useSidebar } from './ui/sidebar'
213
import { TeamSwitcher } from './team-switcher'
224
import { NavMain } from './nav-main'
23-
import { NavProjects } from './nav-projects'
24-
import { NavUser } from './nav-secondary'
255

266
// This is sample data.
277
const data = {
288
user: {
29-
name: 'shadcn',
9+
name: 'username',
3010
email: 'm@example.com',
3111
avatar: '/avatars/shadcn.jpg'
3212
},
3313
teams: [
3414
{
35-
name: 'Acme Inc',
36-
logo: GalleryVerticalEnd,
37-
plan: 'Enterprise'
38-
},
39-
{
40-
name: 'Acme Corp.',
41-
logo: AudioWaveform,
42-
plan: 'Startup'
43-
},
44-
{
45-
name: 'Evil Corp.',
46-
logo: Command,
15+
name: 'Default Team',
16+
logo: TextSelectIcon,
4717
plan: 'Free'
4818
}
4919
],
5020
navMain: [
5121
{
52-
title: 'Playground',
22+
title: 'Notes',
5323
url: '#',
54-
icon: SquareTerminal,
24+
icon: NotebookTabsIcon,
5525
isActive: true,
5626
items: [
5727
{
58-
title: 'History',
28+
title: 'View All',
5929
url: '#'
6030
},
6131
{
6232
title: 'Starred',
6333
url: '#'
64-
},
65-
{
66-
title: 'Settings',
67-
url: '/settings/profile'
68-
}
69-
]
70-
},
71-
{
72-
title: 'Models',
73-
url: '#',
74-
icon: Bot,
75-
items: [
76-
{
77-
title: 'Genesis',
78-
url: '#'
79-
},
80-
{
81-
title: 'Explorer',
82-
url: '#'
83-
},
84-
{
85-
title: 'Quantum',
86-
url: '#'
87-
}
88-
]
89-
},
90-
{
91-
title: 'Documentation',
92-
url: '#',
93-
icon: BookOpen,
94-
items: [
95-
{
96-
title: 'Introduction',
97-
url: '#'
98-
},
99-
{
100-
title: 'Get Started',
101-
url: '#'
102-
},
103-
{
104-
title: 'Tutorials',
105-
url: '#'
106-
},
107-
{
108-
title: 'Changelog',
109-
url: '#'
11034
}
11135
]
11236
},
@@ -115,45 +39,12 @@ const data = {
11539
url: '#',
11640
icon: Settings2,
11741
items: [
118-
{
119-
title: 'Profile',
120-
url: '/settings/profile'
121-
},
122-
{
123-
title: 'Account',
124-
url: '/settings/account'
125-
},
12642
{
12743
title: 'Appearance',
12844
url: '/settings/appearance'
129-
},
130-
{
131-
title: 'Notifications',
132-
url: '/settings/notifications'
133-
},
134-
{
135-
title: 'Display',
136-
url: '/settings/display'
13745
}
13846
]
13947
}
140-
],
141-
projects: [
142-
{
143-
name: 'Design Engineering',
144-
url: '#',
145-
icon: Frame
146-
},
147-
{
148-
name: 'Sales & Marketing',
149-
url: '#',
150-
icon: PieChart
151-
},
152-
{
153-
name: 'Travel',
154-
url: '#',
155-
icon: Map
156-
}
15748
]
15849
}
15950

@@ -167,14 +58,7 @@ export function AppSidebar({ ...props }: React.ComponentProps<typeof Sidebar>):
16758

16859
<SidebarContent>
16960
<NavMain items={data.navMain} />
170-
171-
<NavProjects projects={data.projects} />
17261
</SidebarContent>
173-
174-
<SidebarFooter>
175-
<NavUser user={data.user} />
176-
</SidebarFooter>
177-
17862
<SidebarRail onMouseEnter={() => toggleSidebar()} />
17963
</Sidebar>
18064
)
Lines changed: 2 additions & 124 deletions
Original file line numberDiff line numberDiff line change
@@ -1,32 +1,6 @@
11
import React from 'react'
2-
import {
3-
ArrowDown,
4-
ArrowUp,
5-
Bell,
6-
Copy,
7-
CornerUpLeft,
8-
CornerUpRight,
9-
FileText,
10-
GalleryVerticalEnd,
11-
LineChart,
12-
Link,
13-
MoreHorizontal,
14-
Settings2,
15-
Star,
16-
Trash,
17-
Trash2
18-
} from 'lucide-react'
2+
import { Star } from 'lucide-react'
193
import { Button } from '../../ui/button'
20-
import {
21-
SidebarContent,
22-
SidebarGroup,
23-
SidebarGroupContent,
24-
SidebarMenu,
25-
SidebarMenuItem,
26-
SidebarMenuButton,
27-
Sidebar
28-
} from '../../ui/sidebar'
29-
import { Popover, PopoverContent, PopoverTrigger } from '../../ui/popover'
304
import { formatDistanceToNow } from 'date-fns'
315
import { useQueryClient } from '@tanstack/react-query'
326
import { useLocation } from '@tanstack/react-router'
@@ -36,69 +10,6 @@ import { mutationKeys } from '@renderer/constants/mutation-keys'
3610
import { Tooltip, TooltipContent, TooltipTrigger } from '@renderer/components/ui/tooltip'
3711
import { cn } from '@renderer/utils'
3812

39-
const data = [
40-
[
41-
{
42-
label: 'Customize Page',
43-
icon: Settings2
44-
},
45-
{
46-
label: 'Turn into wiki',
47-
icon: FileText
48-
}
49-
],
50-
[
51-
{
52-
label: 'Copy Link',
53-
icon: Link
54-
},
55-
{
56-
label: 'Duplicate',
57-
icon: Copy
58-
},
59-
{
60-
label: 'Move to',
61-
icon: CornerUpRight
62-
},
63-
{
64-
label: 'Move to Trash',
65-
icon: Trash2
66-
}
67-
],
68-
[
69-
{
70-
label: 'Undo',
71-
icon: CornerUpLeft
72-
},
73-
{
74-
label: 'View analytics',
75-
icon: LineChart
76-
},
77-
{
78-
label: 'Version History',
79-
icon: GalleryVerticalEnd
80-
},
81-
{
82-
label: 'Show delete pages',
83-
icon: Trash
84-
},
85-
{
86-
label: 'Notifications',
87-
icon: Bell
88-
}
89-
],
90-
[
91-
{
92-
label: 'Import',
93-
icon: ArrowUp
94-
},
95-
{
96-
label: 'Export',
97-
icon: ArrowDown
98-
}
99-
]
100-
]
101-
10213
export function NotesNavActions(): React.JSX.Element {
10314
const queryClient = useQueryClient()
10415
const { pathname } = useLocation()
@@ -118,53 +29,20 @@ export function NotesNavActions(): React.JSX.Element {
11829
includeSeconds: true
11930
})}`}
12031
</div>
121-
12232
<Button variant="ghost" size="icon" className="h-7 w-7">
12333
<Star size={16} />
12434
</Button>
125-
12635
<Tooltip>
12736
<TooltipTrigger>
12837
<div
12938
className={cn(
130-
'h-2 w-2 rounded-full',
39+
'h-3 w-3 rounded-full',
13140
isMutatingNote > 0 ? 'bg-blue-500' : 'bg-green-500'
13241
)}
13342
/>
13443
</TooltipTrigger>
135-
13644
<TooltipContent>Saved</TooltipContent>
13745
</Tooltip>
138-
139-
<Popover>
140-
<PopoverTrigger asChild>
141-
<Button variant="ghost" size="icon" className="h-7 w-7 data-[state=open]:bg-accent">
142-
<MoreHorizontal size={16} />
143-
</Button>
144-
</PopoverTrigger>
145-
146-
<PopoverContent className="w-56 overflow-hidden rounded-lg p-0" align="end">
147-
<Sidebar collapsible="none" className="bg-transparent">
148-
<SidebarContent>
149-
{data.map((group, index) => (
150-
<SidebarGroup key={index} className="border-b last:border-none">
151-
<SidebarGroupContent className="gap-0">
152-
<SidebarMenu>
153-
{group.map((item, index) => (
154-
<SidebarMenuItem key={index}>
155-
<SidebarMenuButton>
156-
<item.icon /> <span>{item.label}</span>
157-
</SidebarMenuButton>
158-
</SidebarMenuItem>
159-
))}
160-
</SidebarMenu>
161-
</SidebarGroupContent>
162-
</SidebarGroup>
163-
))}
164-
</SidebarContent>
165-
</Sidebar>
166-
</PopoverContent>
167-
</Popover>
16846
</div>
16947
)
17048
}

0 commit comments

Comments
 (0)