diff --git a/packages/app/src/app/pages/Profile/Showcase/SandboxInfo/elements.js b/packages/app/src/app/pages/Profile/Showcase/SandboxInfo/elements.ts similarity index 98% rename from packages/app/src/app/pages/Profile/Showcase/SandboxInfo/elements.js rename to packages/app/src/app/pages/Profile/Showcase/SandboxInfo/elements.ts index c09bba93d1d..e3f710694a1 100644 --- a/packages/app/src/app/pages/Profile/Showcase/SandboxInfo/elements.js +++ b/packages/app/src/app/pages/Profile/Showcase/SandboxInfo/elements.ts @@ -1,6 +1,7 @@ -import styled from 'styled-components'; import delayEffect from '@codesandbox/common/lib/utils/animation/delay-effect'; import { Link } from 'react-router-dom'; +import styled from 'styled-components'; + import { LikeHeart } from 'app/pages/common/LikeHeart'; export const Container = styled.div` @@ -18,7 +19,6 @@ export const Container = styled.div` `; export const Title = styled.h1` - font-weight: 400; margin: 0; padding: 0; box-sizing: border-box; diff --git a/packages/app/src/app/pages/Profile/Showcase/SandboxInfo/index.js b/packages/app/src/app/pages/Profile/Showcase/SandboxInfo/index.tsx similarity index 77% rename from packages/app/src/app/pages/Profile/Showcase/SandboxInfo/index.js rename to packages/app/src/app/pages/Profile/Showcase/SandboxInfo/index.tsx index a72936625e6..1350296c7a2 100644 --- a/packages/app/src/app/pages/Profile/Showcase/SandboxInfo/index.js +++ b/packages/app/src/app/pages/Profile/Showcase/SandboxInfo/index.tsx @@ -1,19 +1,30 @@ -import React from 'react'; +import Row from '@codesandbox/common/lib/components/flex/Row'; +import { Sandbox } from '@codesandbox/common/lib/types'; import { getSandboxName } from '@codesandbox/common/lib/utils/get-sandbox-name'; import { sandboxUrl } from '@codesandbox/common/lib/utils/url-generator'; -import Row from '@codesandbox/common/lib/components/flex/Row'; +import React, { FunctionComponent } from 'react'; + import { Stat } from 'app/components/Stat'; -import SvgButton from './play-button.svg'; +import { useOvermind } from 'app/overmind'; + import { Container, - Title, - Like, Description, - Stats, + Like, PlayButtonContainer, + Stats, + Title, } from './elements'; +import SvgButton from './play-button.svg'; + +type Props = { + sandbox: Sandbox; +}; +export const SandboxInfo: FunctionComponent = ({ sandbox }) => { + const { + state: { isLoggedIn }, + } = useOvermind(); -function SandboxInfo({ sandbox, isLoggedIn }) { return ( @@ -22,21 +33,24 @@ function SandboxInfo({ sandbox, isLoggedIn }) { {isLoggedIn ? : null} +
{sandbox.description}
+ edit + + +
); -} - -export default SandboxInfo; +}; diff --git a/packages/app/src/app/pages/Profile/Showcase/index.tsx b/packages/app/src/app/pages/Profile/Showcase/index.tsx index 3633e61e45d..416c1e21a31 100644 --- a/packages/app/src/app/pages/Profile/Showcase/index.tsx +++ b/packages/app/src/app/pages/Profile/Showcase/index.tsx @@ -1,4 +1,4 @@ -import React from 'react'; +import React, { FunctionComponent } from 'react'; import { useOvermind } from 'app/overmind'; import Column from '@codesandbox/common/lib/components/flex/Column'; @@ -6,18 +6,17 @@ import Centered from '@codesandbox/common/lib/components/flex/Centered'; import Margin from '@codesandbox/common/lib/components/spacing/Margin'; import { Button } from '@codesandbox/common/lib/components/Button'; -import SandboxInfo from './SandboxInfo'; +import { SandboxInfo } from './SandboxInfo'; import ShowcasePreview from '../../common/ShowcasePreview'; import { ErrorTitle } from './elements'; -export const Showcase: React.FC<{}> = () => { +export const Showcase: FunctionComponent = () => { const { state: { profile, profile: { isLoadingProfile }, preferences: { settings }, - isLoggedIn, }, actions: { profile: { selectSandboxClicked }, @@ -62,13 +61,15 @@ export const Showcase: React.FC<{}> = () => { )} +
+
- +