mirror of
https://github.com/dsoaress/link-free.git
synced 2026-08-17 06:56:04 +01:00
fix: fix initial in dash
This commit is contained in:
@@ -3,6 +3,7 @@ import { useEffect, useState } from 'react'
|
||||
import Collapsible from 'react-collapsible'
|
||||
|
||||
import { useData } from '../../hooks/useData'
|
||||
import type { Data } from '../../types/Data'
|
||||
import { getLocalStorageData, setLocalStorageData } from '../../utils/localStorage'
|
||||
import { Home } from '../Home'
|
||||
import { ColorsSettings } from './ColorsSettings'
|
||||
@@ -10,12 +11,15 @@ import { DataSettings } from './DataSettings'
|
||||
import { SaveChangesAlert } from './SaveChangesAlert'
|
||||
import { Content, Preview, Wrapper } from './styles'
|
||||
|
||||
export function Dash() {
|
||||
type DashProps = {
|
||||
initialData: Data
|
||||
}
|
||||
|
||||
export function Dash({ initialData }: DashProps) {
|
||||
const { data, setData } = useData()
|
||||
const [isLoading, setIsLoading] = useState(true)
|
||||
const [hasUnsavedChanges, setHasUnsavedChanges] = useState(false)
|
||||
const [activeTab, setActiveTab] = useState<'data' | 'colors'>('data')
|
||||
const initialData = data
|
||||
|
||||
useEffect(() => {
|
||||
if (isLoading) {
|
||||
|
||||
@@ -2,9 +2,14 @@ import { GetServerSideProps } from 'next'
|
||||
|
||||
import { Dash } from '../components/Dash'
|
||||
import { fetchData } from '../services/fetchData'
|
||||
import type { Data } from '../types/Data'
|
||||
|
||||
export default function DashPage() {
|
||||
return <Dash />
|
||||
type DashPageProps = {
|
||||
initialData: Data
|
||||
}
|
||||
|
||||
export default function DashPage({ initialData }: DashPageProps) {
|
||||
return <Dash initialData={initialData} />
|
||||
}
|
||||
|
||||
export const getServerSideProps: GetServerSideProps = async () => {
|
||||
|
||||
Reference in New Issue
Block a user