forked from SawyerHood/draw-a-ui
-
Notifications
You must be signed in to change notification settings - Fork 515
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
3d + improve iterations + allow refreshing
- Loading branch information
Showing
7 changed files
with
182 additions
and
87 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -34,3 +34,4 @@ yarn-error.log* | |
# typescript | ||
*.tsbuildinfo | ||
next-env.d.ts | ||
.idea |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,20 +1,20 @@ | ||
import { useEditor, getSvgAsImage, useToasts, createShapeId } from '@tldraw/tldraw' | ||
import { useState } from 'react' | ||
import { PreviewShape } from '../PreviewShape/PreviewShape' | ||
import { getHtmlFromOpenAI } from '../lib/getHtmlFromOpenAI' | ||
import { useMakeReal } from '../hooks/useMakeReal' | ||
|
||
export function ExportButton() { | ||
const makeReal = useMakeReal() | ||
export function ExportButton({ | ||
mode, | ||
}: { | ||
mode: 'tailwind' | 'threejs', | ||
}) { | ||
const makeReal = useMakeReal(mode) | ||
|
||
// A tailwind styled button that is pinned to the bottom right of the screen | ||
return ( | ||
<button | ||
onClick={makeReal} | ||
className="bg-blue-500 hover:bg-blue-700 text-white font-bold py-2 px-4 rounded m-2" | ||
className='bg-blue-500 hover:bg-blue-700 text-white font-bold py-2 px-4 rounded m-2' | ||
style={{ cursor: 'pointer', zIndex: 100000, pointerEvents: 'all' }} | ||
> | ||
Make Real | ||
{`Make Real${mode === 'threejs' ? ' (3D!)' : ''}`} | ||
</button> | ||
) | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.