Skip to content

Commit

Permalink
fix: namespace page project detail empty
Browse files Browse the repository at this point in the history
  • Loading branch information
haydenull committed Jun 12, 2022
1 parent 0035c8f commit b3ca9ce
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 9 deletions.
1 change: 0 additions & 1 deletion src/App.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,6 @@ const App: React.FC<{

useEffect(() => {
async function fetchSchedules() {
console.log('======xxxxxx')
const res = await getInternalEvents()
console.log('[faiz:] === res', res)
if (res) {
Expand Down
2 changes: 1 addition & 1 deletion src/main.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -248,7 +248,7 @@ async function renderApp(env: string) {
let defaultRoute = ''
const page = await logseq.Editor.getCurrentPage()
const { projectList = [] } = getInitalSettings()
if (isEnabledAgendaPage(page?.originalName) || projectList.some(project => project.id === page?.originalName)) defaultRoute = `project/${page?.originalName}`
if (isEnabledAgendaPage(page?.originalName) || projectList.some(project => project.id === page?.originalName)) defaultRoute = `project/${encodeURIComponent(page?.originalName)}`
ReactDOM.render(
<React.StrictMode>
{/* <App env={env} /> */}
Expand Down
15 changes: 8 additions & 7 deletions src/pages/ProjectDetail/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -11,30 +11,31 @@ import ListView from './components/ListView'
import { journalCalendarSchedulesAtom, projectCalendarSchedulesAtom } from '@/model/events'

const index: React.FC<{}> = () => {
const { projectId } = useParams()
const { projectId = '' } = useParams()
const _projectId = decodeURIComponent(projectId)

const [journalCalendarSchedules] = useAtom(journalCalendarSchedulesAtom)
const [projectCalendarSchedules] = useAtom(projectCalendarSchedulesAtom)
const calendarSchedules = projectId === 'Journal' ? journalCalendarSchedules?.schedules : (projectCalendarSchedules.find(item => item?.calendarConfig?.id === projectId)?.schedules || [])
const calendarSchedules = _projectId === 'Journal' ? journalCalendarSchedules?.schedules : (projectCalendarSchedules.find(item => item?.calendarConfig?.id === _projectId)?.schedules || [])

return (
<div className={classNames(s.page, 'page-container p-8 flex flex-col items-center')}>
<h1 className="title-text w-full">{projectId}</h1>
<h1 className="title-text w-full">{_projectId}</h1>
<div className="rounded-2xl flex w-full h-full p-6 bg-quaternary">
{
projectId && (
_projectId && (
<Tabs className="w-full" tabPosition="left">
<Tabs.TabPane tab="List" key="list">
<ListView projectId={projectId} />
<ListView projectId={_projectId} />
</Tabs.TabPane>
<Tabs.TabPane tab="Calendar" key="calendar">
<CalendarCom schedules={calendarSchedules} isProjectCalendar />
</Tabs.TabPane>
<Tabs.TabPane tab="Gantt" key="gantt">
<Gantt projectId={projectId} mode="advanced" />
<Gantt projectId={_projectId} mode="advanced" />
</Tabs.TabPane>
<Tabs.TabPane tab="Timeline" key="timeline">
<Gantt projectId={projectId} mode="simple" />
<Gantt projectId={_projectId} mode="simple" />
</Tabs.TabPane>
</Tabs>
)
Expand Down

0 comments on commit b3ca9ce

Please sign in to comment.