-
-
Notifications
You must be signed in to change notification settings - Fork 50
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #100 from sibelius/feat/chrome
feat(chrome): chrome extension
- Loading branch information
Showing
16 changed files
with
243 additions
and
58 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 |
---|---|---|
@@ -1,6 +1,19 @@ | ||
module.exports = { | ||
presets: [ | ||
['@babel/preset-env', { targets: { node: 'current' } }], | ||
'@babel/preset-typescript' | ||
] | ||
[ | ||
'@babel/preset-react', | ||
{ | ||
runtime: 'automatic', | ||
}, | ||
], | ||
'@babel/preset-typescript', | ||
[ | ||
'@babel/preset-env', | ||
{ | ||
corejs: 3, | ||
modules: false, | ||
useBuiltIns: 'usage', | ||
}, | ||
], | ||
], | ||
}; |
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
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
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 was deleted.
Oops, something went wrong.
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 |
---|---|---|
@@ -0,0 +1,39 @@ | ||
import { useState } from 'react'; | ||
import { Box, Button, Textarea, Badge } from '@chakra-ui/react'; | ||
import { FaTwitter } from 'react-icons/fa'; | ||
|
||
export const TweetComposer = () => { | ||
const [text, setText] = useState(''); | ||
const suffix = '\ncc @sseraphini'; | ||
const counter = 279 - suffix.length - text.length; | ||
const tweet = encodeURIComponent(`${text}${suffix}`); | ||
|
||
return ( | ||
<> | ||
<Textarea | ||
size="sm" | ||
resize="none" | ||
minHeight="10.8rem" | ||
placeholder="Write your tweet concept/question here" | ||
value={text} | ||
onChange={(e) => setText(e.target.value)} | ||
/> | ||
|
||
<Badge maxW="fit-content" colorScheme={counter < 0 ? 'red' : ''}> | ||
{counter} | ||
</Badge> | ||
<Box as="span">cc @sseraphini</Box> | ||
|
||
<Button | ||
colorScheme="twitter" | ||
leftIcon={<FaTwitter />} | ||
mt="10px" | ||
as={'a'} | ||
href={`https://twitter.com/intent/tweet?text=${tweet}`} | ||
target="_blank" | ||
> | ||
Tweet | ||
</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
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 |
---|---|---|
@@ -0,0 +1,7 @@ | ||
{ | ||
"private": true, | ||
"name": "@ccsseraphini/ui", | ||
"version": "0.0.1", | ||
"main": "./src/index.tsx", | ||
"module": "./src/index.tsx" | ||
} |
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 |
---|---|---|
@@ -0,0 +1,39 @@ | ||
import { useState } from 'react'; | ||
import { Box, Button, Textarea, Badge } from '@chakra-ui/react'; | ||
import { FaTwitter } from 'react-icons/fa'; | ||
|
||
export const TweetComposer = () => { | ||
const [text, setText] = useState(''); | ||
const suffix = '\ncc @sseraphini'; | ||
const counter = 279 - suffix.length - text.length; | ||
const tweet = encodeURIComponent(`${text}${suffix}`); | ||
|
||
return ( | ||
<> | ||
<Textarea | ||
size="sm" | ||
resize="none" | ||
minHeight="10.8rem" | ||
placeholder="Write your tweet concept/question here" | ||
value={text} | ||
onChange={(e) => setText(e.target.value)} | ||
/> | ||
|
||
<Badge maxW="fit-content" colorScheme={counter < 0 ? 'red' : ''}> | ||
{counter} | ||
</Badge> | ||
<Box as="span">cc @sseraphini</Box> | ||
|
||
<Button | ||
colorScheme="twitter" | ||
leftIcon={<FaTwitter />} | ||
mt="10px" | ||
as={'a'} | ||
href={`https://twitter.com/intent/tweet?text=${tweet}`} | ||
target="_blank" | ||
> | ||
Tweet | ||
</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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
export { TweetComposer } from './TweetComposer'; |
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.
83625eb
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Successfully deployed to the following URLs: