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:
@@ -25,6 +25,7 @@ const ProjectProfile = ({
|
||||
onDelete,
|
||||
onReaction,
|
||||
onComment,
|
||||
onStlDownload,
|
||||
}) => {
|
||||
const [comment, setComment] = useState('')
|
||||
const [isEditing, setIsEditing] = useState(false)
|
||||
@@ -91,12 +92,25 @@ const ProjectProfile = ({
|
||||
<h3 className="text-5xl capitalize text-ch-gray-300">
|
||||
{project?.title.replace(/-/g, ' ')}
|
||||
</h3>
|
||||
<div className="flex items-center text-gray-100">
|
||||
<span className="pr-4">Built with</span>
|
||||
<CadPackage
|
||||
cadPackage={project?.cadPackage}
|
||||
className="px-3 py-2 rounded"
|
||||
/>
|
||||
<div className="flex items-center text-gray-100 flex-wrap">
|
||||
<div className="flex flex-grow items-center">
|
||||
<span className="pr-4">Built with</span>
|
||||
<CadPackage
|
||||
cadPackage={project?.cadPackage}
|
||||
className="px-3 py-2 rounded"
|
||||
/>
|
||||
</div>
|
||||
<Button
|
||||
className={getActiveClasses(
|
||||
'ml-3 hover:bg-opacity-100 bg-ch-pink-800 bg-opacity-30 mt-4 mb-3 text-ch-gray-300',
|
||||
{ 'bg-indigo-200': currentUser }
|
||||
)}
|
||||
shouldAnimateHover
|
||||
iconName={'document-download'}
|
||||
onClick={onStlDownload}
|
||||
>
|
||||
Download STL
|
||||
</Button>
|
||||
</div>
|
||||
{(project?.description || hasPermissionToEdit) && (
|
||||
<KeyValue
|
||||
|
||||
Reference in New Issue
Block a user