diff --git a/package.json b/package.json index 2dc4fd6..6531ac1 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "tweries-app", - "version": "1.7.9", + "version": "1.7.10", "private": true, "description": "Tweries, a tweet-storm-helper app that breaks up a long paragraph into multiple tweets.", "dependencies": { diff --git a/src/components/Footer/__snapshots__/Footer.test.js.snap b/src/components/Footer/__snapshots__/Footer.test.js.snap index b338839..753d1da 100644 --- a/src/components/Footer/__snapshots__/Footer.test.js.snap +++ b/src/components/Footer/__snapshots__/Footer.test.js.snap @@ -38,7 +38,7 @@ exports[`Footer to match snapshot 1`] = ` v 1.0.0-beta.1 © - 2020 + 2022

diff --git a/src/components/Form/Form.js b/src/components/Form/Form.js index 49a4bd1..a68824d 100644 --- a/src/components/Form/Form.js +++ b/src/components/Form/Form.js @@ -1,8 +1,8 @@ import PropTypes from 'prop-types'; import React from 'react'; import { MAX_LENGTH } from '../../constants'; +import ReplyToTweet from '../../containers/ReplyToTweet/ReplyToTweet'; import Counter from '../Counter/Counter'; -import ReplyToTweet from '../ReplyToTweet/ReplyToTweet'; import Textarea from '../Textarea/Textarea'; import TweetstormButton from '../TweetstormButton/TweetstormButton'; diff --git a/src/components/Form/Form.test.js b/src/components/Form/Form.test.js index ebeb83b..c7be129 100644 --- a/src/components/Form/Form.test.js +++ b/src/components/Form/Form.test.js @@ -1,11 +1,11 @@ import { fireEvent, render } from '@testing-library/react'; import React from 'react'; -import ReplyToTweet from '../ReplyToTweet/ReplyToTweet'; +import ReplyToTweet from '../../containers/ReplyToTweet/ReplyToTweet'; import TweetstormButton from '../TweetstormButton/TweetstormButton'; import Form from './Form'; -jest.mock('../../components/ReplyToTweet/ReplyToTweet'); -jest.mock('../../components/TweetstormButton/TweetstormButton'); +jest.mock('../../containers/ReplyToTweet/ReplyToTweet'); +jest.mock('../TweetstormButton/TweetstormButton'); describe('
', () => { beforeEach(() => { diff --git a/src/containers/Playground/Playground.css b/src/containers/Playground/Playground.css new file mode 100644 index 0000000..97d67d4 --- /dev/null +++ b/src/containers/Playground/Playground.css @@ -0,0 +1,10 @@ +.Playground { + display: flex; + flex-direction: column; + margin: 32px; + width: 512px; +} + +.Playground pre { + margin-top: 32px; +} diff --git a/src/containers/Playground/Playground.js b/src/containers/Playground/Playground.js new file mode 100644 index 0000000..f7012b6 --- /dev/null +++ b/src/containers/Playground/Playground.js @@ -0,0 +1,30 @@ +import React from 'react'; +import { useAuth0 } from '../../react-auth0-wrapper'; +import ReplyToTweet from '../ReplyToTweet/ReplyToTweet'; +import './Playground.css'; + +function Playground() { + const { user } = useAuth0(); + + const tweetUrl = 'https://twitter.com/mattiaerre/status/1256370963622629376'; + + return ( +
+ {user ? ( + <> + +
userId: {user.sub}
+ + ) : ( + Loading user ... + )} +
+ ); +} + +export default Playground; diff --git a/src/components/ReplyToTweet/ReplyToTweet.js b/src/containers/ReplyToTweet/ReplyToTweet.js similarity index 95% rename from src/components/ReplyToTweet/ReplyToTweet.js rename to src/containers/ReplyToTweet/ReplyToTweet.js index 76f8393..f88987e 100644 --- a/src/components/ReplyToTweet/ReplyToTweet.js +++ b/src/containers/ReplyToTweet/ReplyToTweet.js @@ -6,11 +6,9 @@ import fetchTweet from '../../api/fetchTweet'; const copy = { 'If you want to reply to a specific Tweet:': 'If you want to reply to a specific Tweet:', - 'Optional: reply to Tweet URL': 'Optional: reply to Tweet URL', 'URL goes here': 'URL goes here' }; -// TODO: move to containers function ReplyToTweet({ callback, onChange, tweetUrl, userId }) { const [isValidTweet, setIsValidTweet] = useState(false); const [waiting, setWaiting] = useState(false); diff --git a/src/components/ReplyToTweet/ReplyToTweet.test.js b/src/containers/ReplyToTweet/ReplyToTweet.test.js similarity index 100% rename from src/components/ReplyToTweet/ReplyToTweet.test.js rename to src/containers/ReplyToTweet/ReplyToTweet.test.js diff --git a/src/components/ReplyToTweet/__snapshots__/ReplyToTweet.test.js.snap b/src/containers/ReplyToTweet/__snapshots__/ReplyToTweet.test.js.snap similarity index 100% rename from src/components/ReplyToTweet/__snapshots__/ReplyToTweet.test.js.snap rename to src/containers/ReplyToTweet/__snapshots__/ReplyToTweet.test.js.snap diff --git a/src/index.js b/src/index.js index 2afba67..6d62721 100644 --- a/src/index.js +++ b/src/index.js @@ -7,6 +7,7 @@ import './styles.css'; import config from './auth_config.json'; import { AMPLITUDE_KEY } from './constants'; import App from './containers/App/App'; +import Playground from './containers/Playground/Playground'; import features from './features'; import initializeReactGA from './initializeReactGA'; import { Auth0Provider } from './react-auth0-wrapper'; @@ -28,6 +29,8 @@ function onRedirectCallback(appState) { ); } +const { REACT_APP_PLAYGROUND } = process.env; + render( {({ logEvent }) => ( - + {REACT_APP_PLAYGROUND === 'on' ? ( + + ) : ( + + )} )}