feat: publish danable frontend updates
This commit is contained in:
parent
9ed811369d
commit
60dd253565
43 changed files with 920 additions and 714 deletions
|
|
@ -3,7 +3,7 @@ import { Link, useLocation } from 'react-router-dom'
|
|||
import clsx from 'clsx'
|
||||
import { getProjects, subscribeProjectsStore } from '@/pages/projects/projectData'
|
||||
|
||||
export const RecentProjects: React.FC<{ isProjectList?: boolean }> = ({ isProjectList = false }) => {
|
||||
export const RecentProjects: React.FC<{ isProjectWorkspace?: boolean }> = ({ isProjectWorkspace = false }) => {
|
||||
const location = useLocation()
|
||||
const [recentProjects, setRecentProjects] = useState(() => getProjects().slice(0, 3))
|
||||
|
||||
|
|
@ -11,13 +11,12 @@ export const RecentProjects: React.FC<{ isProjectList?: boolean }> = ({ isProjec
|
|||
|
||||
return (
|
||||
<div>
|
||||
<div className={`px-2 mb-2 text-[9px] font-semibold text-slate-500 ${isProjectList ? 'tracking-normal text-[#332926]' : 'uppercase tracking-wider'}`}>
|
||||
<div className={`px-2 mb-2 text-[9px] font-semibold text-slate-500 ${isProjectWorkspace ? 'tracking-normal text-[#332926]' : 'uppercase tracking-wider'}`}>
|
||||
DỰ ÁN GẦN ĐÂY
|
||||
</div>
|
||||
<div className="space-y-0.5">
|
||||
{recentProjects.map((project) => {
|
||||
const projectPath = `/projects/${project.id}`
|
||||
const dotColors = ['bg-[#a29fff]', 'bg-[#a29fff]', 'bg-[#a29fff]']
|
||||
const isCurrent = location.pathname.startsWith(projectPath)
|
||||
return (
|
||||
<Link
|
||||
|
|
@ -25,15 +24,17 @@ export const RecentProjects: React.FC<{ isProjectList?: boolean }> = ({ isProjec
|
|||
to={projectPath}
|
||||
className={clsx(
|
||||
'flex items-center transition-colors',
|
||||
isProjectList
|
||||
? 'gap-2 px-2.5 py-0.5 text-[11px] font-normal leading-[17px] text-[#332926]'
|
||||
isProjectWorkspace
|
||||
? 'gap-2 px-2.5 py-0.5 text-[11px] font-normal leading-[17px] text-[var(--project-heading)]'
|
||||
: 'gap-2.5 rounded-lg px-2.5 py-2 text-xs font-medium',
|
||||
isCurrent
|
||||
? 'bg-slate-100 text-slate-900 font-semibold'
|
||||
: 'text-slate-600 hover:bg-slate-50 hover:text-slate-900'
|
||||
isProjectWorkspace
|
||||
? 'text-[var(--project-heading)]'
|
||||
: isCurrent
|
||||
? 'bg-slate-100 text-slate-900 font-semibold'
|
||||
: 'text-slate-600 hover:bg-slate-50 hover:text-slate-900'
|
||||
)}
|
||||
>
|
||||
<span className={`h-[5px] w-[5px] shrink-0 rounded-full ${isProjectList ? 'bg-[#a29fff]' : 'bg-indigo-500'}`} />
|
||||
<span className={`h-[5px] w-[5px] shrink-0 rounded-full ${isProjectWorkspace ? 'bg-[var(--project-accent-dot)]' : 'bg-indigo-500'}`} />
|
||||
<span className="truncate">{project.name}</span>
|
||||
</Link>
|
||||
)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue