diff --git a/src/client/actions/teamSelectorActions.js b/src/client/actions/teamSelectorActions.js index ad6a3bec..65e3e237 100644 --- a/src/client/actions/teamSelectorActions.js +++ b/src/client/actions/teamSelectorActions.js @@ -1,4 +1,4 @@ -import { FETCH_TEAM_SELECTOR, FETCH_TEAM_SELECTOR_LIST, DELETE_TEAM_SELECTOR } from "./types"; +import { FETCH_TEAM_SELECTOR, FETCH_TEAM_SELECTOR_LIST, FETCH_TEAM_SELECTOR_CHOICES, DELETE_TEAM_SELECTOR } from "./types"; import { toast } from "react-toastify"; export const fetchTeamSelector = id => async (dispatch, getState, api) => { @@ -8,6 +8,13 @@ export const fetchTeamSelector = id => async (dispatch, getState, api) => { } }; +export const fetchTeamSelectorChoices = id => async (dispatch, getState, api) => { + const res = await api.get(`/teamSelectors/${id}/choices`); + if (res.data) { + dispatch({ type: FETCH_TEAM_SELECTOR_CHOICES, payload: { id, choices: res.data } }); + } +}; + export const fetchTeamSelectorForGame = id => async (dispatch, getState, api) => { const res = await api.get(`/teamSelectors/game/${id}`); dispatch({ type: FETCH_TEAM_SELECTOR, payload: res.data }); diff --git a/src/client/actions/types.js b/src/client/actions/types.js index f0195d1a..843d2b53 100644 --- a/src/client/actions/types.js +++ b/src/client/actions/types.js @@ -103,6 +103,7 @@ export const SEND_ERROR = "send_error"; //Team Selectors export const FETCH_TEAM_SELECTOR_LIST = "fetch_team_selector_list"; export const FETCH_TEAM_SELECTOR = "fetch_team_selector"; +export const FETCH_TEAM_SELECTOR_CHOICES = "fetch_team_selector_choices"; export const DELETE_TEAM_SELECTOR = "delete_team_selector"; //OAuth diff --git a/src/client/components/social/ShareDialog.js b/src/client/components/social/ShareDialog.js index 66a1cfe1..37875610 100644 --- a/src/client/components/social/ShareDialog.js +++ b/src/client/components/social/ShareDialog.js @@ -129,15 +129,7 @@ class ShareDialog extends Component { } renderDialog() { - const { - authorisedAccounts, - fetchingPreview, - images, - isSubmitting, - service, - services, - submittedPost - } = this.state; + const { authorisedAccounts, fetchingPreview, images, isSubmitting, service, services, submittedPost } = this.state; if (service) { let content; @@ -153,11 +145,7 @@ class ShareDialog extends Component { content = (
- To share to Twitter, you will need to click the button below and authorise posts from this - website. Granting authorisation simply allows you to post to your own account - from this website. + To share to Twitter, you will need to click the button below and authorise posts from this website. Granting authorisation simply allows{" "} + you to post to your own account from this website.
,- No personal data is ever saved by us, and your password is never exposed by Twitter, meaning it - is impossible for us (or anyone else) to access your account or post without your consent. + No personal data is ever saved by us, and your password is never exposed by Twitter, meaning it is impossible for us (or anyone else) to + access your account or post without your consent.
]; break; @@ -297,25 +279,18 @@ class ShareDialog extends Component {- Upon clicking the Share button, a Twitter window will pop up asking you to grant access - to {site_name} (the website, not the page/group). If you accept, an access token will be - saved to your web browser. + Upon clicking the Share button, a Twitter window will pop up asking you to grant access to {site_name} (the website, not the + page/group). If you accept, an access token will be saved to your web browser.
- This access token is a long string of letters and numbers, generated by Twitter to allow - other apps to post to your account without accessing twitter.com directly. It is - accessible only within your web browser, so at no point can this be accessed or used by - the 4Fs team (or anyone else). + This access token is a long string of letters and numbers, generated by Twitter to allow other apps to post to your account + without accessing twitter.com directly. It is accessible only within your web browser, so at no point can this be accessed or + used by the 4Fs team (or anyone else).
- The access token can easily be deleted, if you wish, either by clicking the{" "} - Disconnect link above the Tweet editor, or by revoking it directly on - Twitter. If you have any more questions,{" "} - + The access token can easily be deleted, if you wish, either by clicking the Disconnect link above the Tweet + editor, or by revoking it directly on Twitter. If you have any more questions,{" "} + just let us know
@@ -325,9 +300,7 @@ class ShareDialog extends Component { } if (content) { - return ( -Thank you, your choices have been saved!
{"Want to make a change? "}
- this.setState({ editMode: true })}>
+ this.setState({ enforceEditMode: true })}>
Click Here
{" to edit your team"}
@@ -109,9 +119,9 @@ class ShareableTeamSelector extends Component {
render() {
const { fullTeams, localTeam } = this.props;
- const { editMode, isLoadingTeam, selector, squadNumbers } = this.state;
+ const { isLoadingTeam, isLoadingChoices, selector, squadNumbers } = this.state;
- if (isLoadingTeam) {
+ if (isLoadingTeam || isLoadingChoices) {
return