conditional rendering based on file type
This commit is contained in:
@@ -159,7 +159,8 @@ const Home: NextPage = () => {
|
|||||||
>
|
>
|
||||||
<main style={{ display: 'flex', flex: 1, position: 'relative' }}>
|
<main style={{ display: 'flex', flex: 1, position: 'relative' }}>
|
||||||
<HooksEditor />
|
<HooksEditor />
|
||||||
{snap.files[snap.active]?.name?.split('.')?.[1]?.toLowerCase() === 'c' && (
|
{(snap.files[snap.active]?.name?.split('.')?.[1]?.toLowerCase() === 'c' ||
|
||||||
|
snap.files[snap.active]?.name?.split('.')?.[1]?.toLowerCase() === 'ts') && (
|
||||||
<Hotkeys
|
<Hotkeys
|
||||||
keyName="command+b,ctrl+b"
|
keyName="command+b,ctrl+b"
|
||||||
onKeyDown={() => !snap.compiling && snap.files.length && compileCode(snap.active)}
|
onKeyDown={() => !snap.compiling && snap.files.length && compileCode(snap.active)}
|
||||||
@@ -185,11 +186,13 @@ const Home: NextPage = () => {
|
|||||||
<Play weight="bold" size="16px" />
|
<Play weight="bold" size="16px" />
|
||||||
Compile to Wasm
|
Compile to Wasm
|
||||||
</Button>
|
</Button>
|
||||||
<Popover content={<CompilerSettings />}>
|
{snap.files[snap.active].language === 'c' && (
|
||||||
<Button variant="primary" css={{ px: '10px' }}>
|
<Popover content={<CompilerSettings />}>
|
||||||
<Gear size="16px" />
|
<Button variant="primary" css={{ px: '10px' }}>
|
||||||
</Button>
|
<Gear size="16px" />
|
||||||
</Popover>
|
</Button>
|
||||||
|
</Popover>
|
||||||
|
)}
|
||||||
</Flex>
|
</Flex>
|
||||||
</Hotkeys>
|
</Hotkeys>
|
||||||
)}
|
)}
|
||||||
|
|||||||
Reference in New Issue
Block a user