-
Notifications
You must be signed in to change notification settings - Fork 220
Feat: 优化了filetree的样式 #320
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Merged
Feat: 优化了filetree的样式 #320
Changes from 2 commits
Commits
Show all changes
4 commits
Select commit
Hold shift + click to select a range
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -38,20 +38,20 @@ const DocumentGroupHeader: React.FC<DocumentGroupHeaderProps> = ({ | |
| const getGroupColor = () => { | ||
| switch (type) { | ||
| case 'personal': | ||
| return 'from-blue-500 to-indigo-600'; | ||
| return 'bg-[#e0e0e0] dark:bg-[#3a3a3a]'; | ||
| case 'organization': | ||
| return 'from-purple-500 to-pink-600'; | ||
| return 'bg-[#e0e0e0] dark:bg-[#3a3a3a]'; | ||
| case 'shared': | ||
| return 'from-green-500 to-emerald-600'; | ||
| return 'bg-[#e0e0e0] dark:bg-[#3a3a3a]'; | ||
| default: | ||
| return 'from-slate-500 to-slate-600'; | ||
| return 'bg-[#e0e0e0] dark:bg-[#3a3a3a]'; | ||
| } | ||
| }; | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. |
||
|
|
||
| return ( | ||
| <div | ||
| className={cn( | ||
| 'flex items-center justify-between px-3 py-2.5 mx-2 my-1', | ||
| 'flex items-center justify-between py-2.5 mx-2 my-1', | ||
| 'cursor-pointer select-none group', | ||
| 'rounded-lg transition-all duration-200', | ||
| 'hover:bg-gradient-to-r hover:from-slate-100/80 hover:to-slate-50/80', | ||
|
|
@@ -79,7 +79,7 @@ const DocumentGroupHeader: React.FC<DocumentGroupHeaderProps> = ({ | |
| getGroupColor(), | ||
| )} | ||
| > | ||
| <Icon name={getGroupIcon() as any} className="w-3 h-3 text-white" /> | ||
| <Icon name={getGroupIcon() as any} className="w-3 h-3 text-[#333] dark:text-[#cccccc]" /> | ||
| </div> | ||
|
|
||
| {/* 分组名称 */} | ||
|
|
||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -76,13 +76,13 @@ const FileTree: React.FC<FileTreeProps> = (props) => { | |
| <div | ||
| className={cn( | ||
| 'w-5 h-5 rounded-md flex items-center justify-center', | ||
| 'bg-gradient-to-br from-emerald-400 to-green-500', | ||
| 'shadow-md shadow-emerald-500/30', | ||
| 'bg-[#e0e0e0] dark:bg-[#3a3a3a]', | ||
| 'shadow-sm', | ||
| )} | ||
| > | ||
| <Icon | ||
| name={newItemType === 'folder' ? 'Folder' : 'FileText'} | ||
| className="h-3.5 w-3.5 text-white drop-shadow-sm" | ||
| className="h-3.5 w-3.5 text-[#333]" | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. |
||
| /> | ||
| </div> | ||
| </div> | ||
|
|
@@ -113,9 +113,8 @@ const FileTree: React.FC<FileTreeProps> = (props) => { | |
| <button | ||
| className={cn( | ||
| 'p-2 rounded-xl transition-all duration-300 transform hover:scale-110', | ||
| 'bg-gradient-to-br from-green-500 to-emerald-600', | ||
| 'text-white shadow-lg shadow-green-500/30', | ||
| 'hover:from-green-600 hover:to-emerald-700', | ||
| 'bg-[#e0e0e0] dark:bg-[#3a3a3a]', | ||
| 'text-[#333] shadow-sm', | ||
| )} | ||
| onClick={() => onFinishCreateNewItem()} | ||
| title="确认" | ||
|
|
@@ -125,9 +124,8 @@ const FileTree: React.FC<FileTreeProps> = (props) => { | |
| <button | ||
| className={cn( | ||
| 'p-2 rounded-xl transition-all duration-300 transform hover:scale-110', | ||
| 'bg-gradient-to-br from-red-500 to-pink-600', | ||
| 'text-white shadow-lg shadow-red-500/30', | ||
| 'hover:from-red-600 hover:to-pink-700', | ||
| 'bg-[#e0e0e0] dark:bg-[#3a3a3a]', | ||
| 'text-[#333] shadow-sm', | ||
| )} | ||
| onClick={onCancelCreateNewItem} | ||
| title="取消" | ||
|
|
||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -72,10 +72,9 @@ const GroupedFileTree: React.FC<GroupedFileTreeProps> = (props) => { | |
| data-new-item-container | ||
| className={cn( | ||
| 'flex items-center py-2 px-3 text-sm mx-2 my-0.5', | ||
| 'bg-gradient-to-r from-green-50 via-emerald-50/80 to-green-50', | ||
| 'dark:from-green-900/20 dark:via-emerald-900/20 dark:to-green-900/20', | ||
| 'border border-green-200/60 dark:border-green-700/50 rounded-lg', | ||
| 'shadow-md shadow-green-200/20 dark:shadow-green-800/20', | ||
| 'bg-[#f0f0f0] dark:bg-[#2a2d2e]', | ||
| 'border border-[#999999] dark:border-[#555555] rounded-lg', | ||
| 'shadow-sm', | ||
| 'overflow-hidden', | ||
| )} | ||
| onClick={(e) => e.stopPropagation()} | ||
|
|
@@ -84,13 +83,13 @@ const GroupedFileTree: React.FC<GroupedFileTreeProps> = (props) => { | |
| <div | ||
| className={cn( | ||
| 'w-5 h-5 rounded-md flex items-center justify-center', | ||
| 'bg-gradient-to-br from-emerald-400 to-green-500', | ||
| 'shadow-md shadow-emerald-500/30', | ||
| 'bg-[#e0e0e0] dark:bg-[#3a3a3a]', | ||
| 'shadow-sm', | ||
| )} | ||
| > | ||
| <Icon | ||
| name={newItemType === 'folder' ? 'Folder' : 'FileText'} | ||
| className="h-3.5 w-3.5 text-white drop-shadow-sm" | ||
| className="h-3.5 w-3.5 text-[#333]" | ||
| /> | ||
| </div> | ||
| </div> | ||
|
|
@@ -100,12 +99,12 @@ const GroupedFileTree: React.FC<GroupedFileTreeProps> = (props) => { | |
| type="text" | ||
| className={cn( | ||
| 'flex-1 bg-white/90 dark:bg-slate-700/90 backdrop-blur-sm', | ||
| 'border-2 border-green-400/70 dark:border-green-500/70', | ||
| 'focus:border-green-500 dark:focus:border-green-400', | ||
| 'focus:ring-2 focus:ring-green-500/30 dark:focus:ring-green-400/30', | ||
| 'border-2 border-[#999999] dark:border-[#555555]', | ||
| 'focus:border-[#333] dark:focus:border-[#cccccc]', | ||
| 'focus:ring-2 focus:ring-[#333]/30 dark:focus:ring-[#cccccc]/30', | ||
| 'px-3 py-2 text-sm rounded-lg transition-all duration-300', | ||
| 'text-slate-900 dark:text-slate-100', | ||
| 'shadow-lg shadow-green-200/30 dark:shadow-green-800/20', | ||
| 'shadow-sm', | ||
| 'min-w-0', | ||
| )} | ||
| value={newItemName} | ||
|
|
@@ -119,9 +118,8 @@ const GroupedFileTree: React.FC<GroupedFileTreeProps> = (props) => { | |
| <button | ||
| className={cn( | ||
| 'p-2 rounded-xl transition-all duration-300 transform hover:scale-110', | ||
| 'bg-gradient-to-br from-green-500 to-emerald-600', | ||
| 'text-white shadow-lg shadow-green-500/30', | ||
| 'hover:from-green-600 hover:to-emerald-700', | ||
| 'bg-[#e0e0e0] dark:bg-[#3a3a3a]', | ||
| 'text-[#333] shadow-sm', | ||
| )} | ||
| onClick={() => onFinishCreateNewItem()} | ||
| title="确认" | ||
|
|
@@ -131,9 +129,8 @@ const GroupedFileTree: React.FC<GroupedFileTreeProps> = (props) => { | |
| <button | ||
| className={cn( | ||
| 'p-2 rounded-xl transition-all duration-300 transform hover:scale-110', | ||
| 'bg-gradient-to-br from-red-500 to-pink-600', | ||
| 'text-white shadow-lg shadow-red-500/30', | ||
| 'hover:from-red-600 hover:to-pink-700', | ||
| 'bg-[#e0e0e0] dark:bg-[#3a3a3a]', | ||
| 'text-[#333] shadow-sm', | ||
| )} | ||
| onClick={onCancelCreateNewItem} | ||
| title="取消" | ||
|
|
@@ -222,28 +219,28 @@ const GroupedFileTree: React.FC<GroupedFileTreeProps> = (props) => { | |
| <div className="relative"> | ||
| <div | ||
| className={cn( | ||
| 'w-16 h-16 rounded-2xl flex items-center justify-center shadow-lg', | ||
| 'w-16 h-16 rounded-2xl flex items-center justify-center shadow-sm', | ||
| group.type === 'shared' | ||
| ? 'bg-gradient-to-br from-green-50 to-emerald-100 dark:from-green-900/20 dark:to-emerald-900/30' | ||
| ? 'bg-[#f0f0f0] dark:bg-[#2a2d2e]' | ||
| : group.type === 'organization' | ||
| ? 'bg-gradient-to-br from-purple-50 to-indigo-100 dark:from-purple-900/20 dark:to-indigo-900/30' | ||
| : 'bg-gradient-to-br from-blue-50 to-cyan-100 dark:from-blue-900/20 dark:to-cyan-900/30', | ||
| ? 'bg-[#f0f0f0] dark:bg-[#2a2d2e]' | ||
| : 'bg-[#f0f0f0] dark:bg-[#2a2d2e]', | ||
|
Comment on lines
223
to
+227
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. |
||
| )} | ||
| > | ||
| <Icon | ||
| name={group.type === 'shared' ? 'Share2' : 'FolderOpen'} | ||
| className={cn( | ||
| 'w-8 h-8', | ||
| group.type === 'shared' | ||
| ? 'text-green-500 dark:text-green-400' | ||
| ? 'text-[#333] dark:text-[#cccccc]' | ||
| : group.type === 'organization' | ||
| ? 'text-purple-500 dark:text-purple-400' | ||
| : 'text-blue-500 dark:text-blue-400', | ||
| ? 'text-[#333] dark:text-[#cccccc]' | ||
| : 'text-[#333] dark:text-[#cccccc]', | ||
| )} | ||
| /> | ||
| </div> | ||
| {/* 装饰性光点 */} | ||
| <div className="absolute -top-1 -right-1 w-4 h-4 bg-gradient-to-br from-yellow-400 to-orange-500 rounded-full opacity-70 blur-sm"></div> | ||
| <div className="absolute -top-1 -right-1 w-4 h-4 bg-[#999999] rounded-full opacity-50"></div> | ||
| </div> | ||
|
|
||
| <div className="space-y-1"> | ||
|
|
||
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
使用硬编码的颜色值(如
text-[#333])会降低代码的可维护性。建议将这些颜色定义在 Tailwind 主题中,并使用语义化的类名(如text-neutral-900)。这样可以统一管理颜色,方便未来进行主题切换或调整。此问题在此次 PR 的多个文件中都存在。