修正大部分的编译错误。
This commit is contained in:
@@ -1,6 +1,8 @@
|
||||
import { isEqual, isNil } from 'lodash-es';
|
||||
import { useState } from 'react';
|
||||
import { Tab } from '../../components/Tab';
|
||||
import { MaterialDesign2SchemeStorage } from '../../material-2-scheme';
|
||||
import { SchemeContent } from '../../models';
|
||||
import { SchemeExport } from './Export';
|
||||
import { M2SchemeBuilder } from './m2-scheme/Builder';
|
||||
import { M2SchemePreview } from './m2-scheme/Preview';
|
||||
@@ -11,18 +13,18 @@ const tabOptions = [
|
||||
{ title: 'Exports', id: 'export' },
|
||||
];
|
||||
|
||||
type M3SchemeProps = {
|
||||
scheme: SchemeContent<MaterialDesign3SchemeStorage>;
|
||||
type M2SchemeProps = {
|
||||
scheme: SchemeContent<MaterialDesign2SchemeStorage>;
|
||||
};
|
||||
|
||||
export function M2Scheme({ scheme }: M3SchemeProps) {
|
||||
export function M2Scheme({ scheme }: M2SchemeProps) {
|
||||
const [activeTab, setActiveTab] = useState<(typeof tabOptions)[number]['id']>(() =>
|
||||
isNil(scheme.schemeStorage.scheme) ? 'builder' : 'overview',
|
||||
);
|
||||
|
||||
return (
|
||||
<>
|
||||
<Tab tabs={tabOptions} activeTab={activeTab} onActive={setActiveTab} />
|
||||
<Tab tabs={tabOptions} activeTab={activeTab} onActive={(v) => setActiveTab(v as string)} />
|
||||
{isEqual(activeTab, 'overview') && <M2SchemePreview scheme={scheme} />}
|
||||
{isEqual(activeTab, 'builder') && (
|
||||
<M2SchemeBuilder scheme={scheme} onBuildComplete={() => setActiveTab('overview')} />
|
||||
|
Reference in New Issue
Block a user