Add "STL Download" to project profile page (#585)
* Moved EditorMenu/helpers.ts file to src/helpers. Reused STL download helper on a new button in the project profile page * Tweak download STL style - flex-wrap the column and grow original "built with" content so the button is pushed write but remains responsive on smaller screens
This commit was merged in pull request #585.
This commit is contained in:
@@ -2,6 +2,7 @@ import { useMutation } from '@redwoodjs/web'
|
||||
import { toast } from '@redwoodjs/web/toast'
|
||||
import { navigate, routes } from '@redwoodjs/router'
|
||||
import { useAuth } from '@redwoodjs/auth'
|
||||
import { makeStlDownloadHandler } from 'src/helpers/download_stl'
|
||||
import { useIdeState } from 'src/helpers/hooks/useIdeState'
|
||||
import { IdeContext } from 'src/helpers/hooks/useIdeContext'
|
||||
import { CREATE_PROJECT_MUTATION } from 'src/components/NavPlusButton/NavPlusButton'
|
||||
@@ -192,6 +193,15 @@ export const Success = ({ userProject, refetch }) => {
|
||||
},
|
||||
})
|
||||
|
||||
const onStlDownload = makeStlDownloadHandler({
|
||||
type: state.objectData?.type,
|
||||
ideType: state.ideType,
|
||||
geometry: state.objectData?.data,
|
||||
quality: state.objectData?.quality,
|
||||
fileName: `${userProject.title }.stl`,
|
||||
thunkDispatch,
|
||||
})
|
||||
|
||||
return (
|
||||
<IdeContext.Provider
|
||||
value={{
|
||||
@@ -213,6 +223,7 @@ export const Success = ({ userProject, refetch }) => {
|
||||
onDelete={onDelete}
|
||||
onReaction={onReaction}
|
||||
onComment={onComment}
|
||||
onStlDownload={onStlDownload}
|
||||
/>
|
||||
</IdeContext.Provider>
|
||||
)
|
||||
|
||||
Reference in New Issue
Block a user