Skip to content

Commit 10c21d6

Browse files
SaraVieiraCompuIves
authored andcommitted
Add Share on Dev and Share on Twitter (codesandbox#1851)
* add newe share * share on twitter
1 parent 29e8858 commit 10c21d6

File tree

1 file changed

+30
-0
lines changed
  • packages/app/src/app/pages/common/Modals/ShareModal

1 file changed

+30
-0
lines changed

packages/app/src/app/pages/common/Modals/ShareModal/index.js

Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@ import { inject, observer } from 'mobx-react';
33
import Files from 'embed/components/Files';
44
import QRCode from 'qrcode.react';
55
import track from '@codesandbox/common/lib/utils/analytics';
6+
import { Button } from '@codesandbox/common/lib/components/Button';
67
import { sandboxUrl } from '@codesandbox/common/lib/utils/url-generator';
78
import Title from './Title';
89

@@ -292,6 +293,35 @@ class ShareView extends React.Component {
292293
/>
293294
</Inputs>
294295
</Title>
296+
<Title title="Share on Social Media">
297+
<Inputs
298+
style={{
299+
margin: '20px 0',
300+
}}
301+
>
302+
<Button
303+
small
304+
target="_blank"
305+
href={`https://dev.to/new?prefill=---%5Cn%20title:${encodeURIComponent(
306+
sandbox.title || sandbox.id
307+
)}%5Cn%20published:%20false%5Cn%20tags:%20codesandbox%5Cn%20---%5Cn%20%5Cn%20%5Cn%20%5Cn%20%7B%25%20codesandbox%20${encodeURIComponent(
308+
sandbox.id
309+
)}%20%25%7D`}
310+
>
311+
Share on DEV
312+
</Button>
313+
<Button
314+
style={{ marginLeft: '1em' }}
315+
small
316+
target="_blank"
317+
href={`https://twitter.com/intent/tweet?text=${encodeURIComponent(
318+
sandbox.title || sandbox.id
319+
)}.+${getEditorUrl(sandbox, mainModule, this.state)}`}
320+
>
321+
Share on Twitter
322+
</Button>
323+
</Inputs>
324+
</Title>
295325
</section>
296326
</Wrapper>
297327
</ShareOptions>

0 commit comments

Comments
 (0)