Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Enable Gosu integration #2106

Open
wants to merge 3 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .env
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
REACT_APP_API_HOST=https://api.opendota.com
BROWSER=none
ENABLE_GOSUAI=false
REACT_APP_ENABLE_GOSUAI=1
2 changes: 1 addition & 1 deletion src/components/Home/Sponsors.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ const Sponsors = ({ strings }) => (
<a href="https://www.rivalry.com" target="_blank" rel="noopener noreferrer">
<img src="/assets/images/rivalry-logo.png" alt="" />
</a>
{ process.env.ENABLE_GOSUAI &&
{ process.env.REACT_APP_ENABLE_GOSUAI &&
<a href="https://gosu.ai/dota/?utm_source=opendota&utm_medium=cpc&utm_campaign=Home" target="_blank" rel="noopener noreferrer">
<img src="/assets/images/gosu-logo.png" alt="" />
</a> }
Expand Down
2 changes: 1 addition & 1 deletion src/components/Match/Draft/Draft.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -217,7 +217,7 @@ const Draft = ({
<section className="teams">
<Heading
title={`${getTeamName(radiantTeam, true)}`}
buttonLabel={process.env.ENABLE_GOSUAI ? strings.gosu_default : null}
buttonLabel={process.env.REACT_APP_ENABLE_GOSUAI ? strings.gosu_default : null}
buttonTo={`${sponsorURL}Draft`}
buttonIcon={sponsorIcon}
icon={<IconRadiant />}
Expand Down
2 changes: 1 addition & 1 deletion src/components/Match/Laning/index.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ class Laning extends React.Component {
<StyledFlexElement>
<Heading
title={strings.th_map}
buttonLabel={process.env.ENABLE_GOSUAI ? strings.gosu_laning : null}
buttonLabel={process.env.REACT_APP_ENABLE_GOSUAI ? strings.gosu_laning : null}
buttonTo={`${sponsorURL}Laning`}
buttonIcon={sponsorIcon}
/>
Expand Down
2 changes: 1 addition & 1 deletion src/components/Match/Overview/Overview.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ const Overview = (strings, gosuUrl, gosuIcon) => {
players={match.players}
columns={overviewColumns(match)}
heading={strings.heading_overview}
buttonLabel={process.env.ENABLE_GOSUAI ? strings.gosu_default : null}
buttonLabel={process.env.REACT_APP_ENABLE_GOSUAI ? strings.gosu_default : null}
buttonTo={`${gosuUrl}Overview`}
buttonIcon={gosuIcon}
picksBans={match.picks_bans}
Expand Down
2 changes: 1 addition & 1 deletion src/components/Match/Purchases/index.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@ class Purchases extends React.Component {
players={match.players}
columns={purchaseTimesColumns(match, this.state.showConsumables)}
heading={strings.heading_purchase_log}
buttonLabel={process.env.ENABLE_GOSUAI ? strings.gosu_default : null}
buttonLabel={process.env.REACT_APP_ENABLE_GOSUAI ? strings.gosu_default : null}
buttonTo={`${sponsorURL}Purchases`}
buttonIcon={sponsorIcon}
radiantTeam={match.radiant_team}
Expand Down
2 changes: 1 addition & 1 deletion src/components/Match/TeamfightMap/index.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -499,7 +499,7 @@ class TeamfightMap extends Component {
players={teamfight.players && teamfight.players.filter(p => p.participate)}
columns={teamfightColumns}
heading={strings.heading_teamfights}
buttonLabel={process.env.ENABLE_GOSUAI ? strings.gosu_teamfights : null}
buttonLabel={process.env.REACT_APP_ENABLE_GOSUAI ? strings.gosu_teamfights : null}
buttonTo={`${sponsorURL}Teamfights`}
buttonIcon={sponsorIcon}
radiantTeam={this.props.match.radiant_team}
Expand Down
2 changes: 1 addition & 1 deletion src/components/Match/Vision/index.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -236,7 +236,7 @@ class Vision extends React.Component {
</div>
<div style={{ flexGrow: '2' }}>
<Heading
buttonLabel={process.env.ENABLE_GOSUAI ? strings.gosu_vision : null}
buttonLabel={process.env.REACT_APP_ENABLE_GOSUAI ? strings.gosu_vision : null}
buttonTo={`${sponsorURL}Vision`}
buttonIcon={sponsorIcon}
/>
Expand Down
26 changes: 13 additions & 13 deletions src/components/Match/matchPages.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -77,7 +77,7 @@ const matchPages = (strings) => {
players={match.players}
columns={benchmarksColumns(match)}
heading={strings.heading_benchmarks}
buttonLabel={process.env.ENABLE_GOSUAI ? strings.gosu_benchmarks : null}
buttonLabel={process.env.REACT_APP_ENABLE_GOSUAI ? strings.gosu_benchmarks : null}
buttonTo={`${gosuUrl}Benchmarks`}
buttonIcon={gosuIcon}
radiantTeam={match.radiant_team}
Expand Down Expand Up @@ -114,7 +114,7 @@ const matchPages = (strings) => {
players={match.players}
columns={performanceColumns}
heading={strings.heading_performances}
buttonLabel={process.env.ENABLE_GOSUAI ? strings.gosu_performances : null}
buttonLabel={process.env.REACT_APP_ENABLE_GOSUAI ? strings.gosu_performances : null}
buttonTo={`${gosuUrl}Performances`}
buttonIcon={gosuIcon}
radiantTeam={match.radiant_team}
Expand All @@ -139,7 +139,7 @@ const matchPages = (strings) => {
parsed: true,
content: match => (
<div>
{process.env.ENABLE_GOSUAI &&
{process.env.REACT_APP_ENABLE_GOSUAI &&
<Heading
buttonLabel={strings.gosu_combat}
buttonTo={`${gosuUrl}Combat`}
Expand Down Expand Up @@ -176,7 +176,7 @@ const matchPages = (strings) => {
players={match.players}
columns={unitKillsColumns}
heading={strings.heading_unit_kills}
buttonLabel={process.env.ENABLE_GOSUAI ? strings.gosu_farm : null}
buttonLabel={process.env.REACT_APP_ENABLE_GOSUAI ? strings.gosu_farm : null}
buttonTo={`${gosuUrl}Farm`}
buttonIcon={gosuIcon}
radiantTeam={match.radiant_team}
Expand Down Expand Up @@ -265,7 +265,7 @@ const matchPages = (strings) => {
players={match.players}
columns={castsColumns}
heading={strings.heading_casts}
buttonLabel={process.env.ENABLE_GOSUAI ? strings.gosu_default : null}
buttonLabel={process.env.REACT_APP_ENABLE_GOSUAI ? strings.gosu_default : null}
buttonTo={`${gosuUrl}Casts`}
buttonIcon={gosuIcon}
radiantTeam={match.radiant_team}
Expand All @@ -284,7 +284,7 @@ const matchPages = (strings) => {
players={match.players}
columns={objectiveDamageColumns}
heading={strings.heading_objective_damage}
buttonLabel={process.env.ENABLE_GOSUAI ? strings.gosu_default : null}
buttonLabel={process.env.REACT_APP_ENABLE_GOSUAI ? strings.gosu_default : null}
buttonTo={`${gosuUrl}Objectives`}
buttonIcon={gosuIcon}
radiantTeam={match.radiant_team}
Expand Down Expand Up @@ -318,7 +318,7 @@ const matchPages = (strings) => {
players={match.players}
columns={actionsColumns}
heading={strings.heading_actions}
buttonLabel={process.env.ENABLE_GOSUAI ? strings.gosu_actions : null}
buttonLabel={process.env.REACT_APP_ENABLE_GOSUAI ? strings.gosu_actions : null}
buttonTo={`${gosuUrl}Actions`}
buttonIcon={gosuIcon}
radiantTeam={match.radiant_team}
Expand Down Expand Up @@ -346,7 +346,7 @@ const matchPages = (strings) => {
players={match.players}
columns={analysisColumns}
heading={strings.heading_analysis}
buttonLabel={process.env.ENABLE_GOSUAI ? strings.gosu_analysis : null}
buttonLabel={process.env.REACT_APP_ENABLE_GOSUAI ? strings.gosu_analysis : null}
buttonTo={`${gosuUrl}Analysis`}
buttonIcon={gosuIcon}
radiantTeam={match.radiant_team}
Expand All @@ -362,7 +362,7 @@ const matchPages = (strings) => {
<div>
<Heading
title={strings.heading_cosmetics}
buttonLabel={process.env.ENABLE_GOSUAI ? strings.gosu_default : null}
buttonLabel={process.env.REACT_APP_ENABLE_GOSUAI ? strings.gosu_default : null}
buttonTo={`${gosuUrl}Cosmetics`}
buttonIcon={gosuIcon}
/>
Expand All @@ -378,7 +378,7 @@ const matchPages = (strings) => {
<div>
<Heading
title={strings.heading_log}
buttonLabel={process.env.ENABLE_GOSUAI ? strings.gosu_default : null}
buttonLabel={process.env.REACT_APP_ENABLE_GOSUAI ? strings.gosu_default : null}
buttonTo={`${gosuUrl}Log`}
buttonIcon={gosuIcon}
/>
Expand All @@ -394,7 +394,7 @@ const matchPages = (strings) => {
players={match.players}
columns={fantasyColumns}
heading={strings.heading_fantasy}
buttonLabel={process.env.ENABLE_GOSUAI ? strings.gosu_default : null}
buttonLabel={process.env.REACT_APP_ENABLE_GOSUAI ? strings.gosu_default : null}
buttonTo={`${gosuUrl}Fantasy`}
buttonIcon={gosuIcon}
radiantTeam={match.radiant_team}
Expand Down Expand Up @@ -426,7 +426,7 @@ const matchPages = (strings) => {
<div>
<Heading
title={strings.heading_chat}
buttonLabel={process.env.ENABLE_GOSUAI ? strings.gosu_default : null}
buttonLabel={process.env.REACT_APP_ENABLE_GOSUAI ? strings.gosu_default : null}
buttonTo={`${gosuUrl}Chat`}
buttonIcon={gosuIcon}
/>
Expand All @@ -442,7 +442,7 @@ const matchPages = (strings) => {
<div>
<Heading
title={strings.heading_story}
buttonLabel={process.env.ENABLE_GOSUAI ? strings.gosu_default : null}
buttonLabel={process.env.REACT_APP_ENABLE_GOSUAI ? strings.gosu_default : null}
buttonTo={`${gosuUrl}Story`}
buttonIcon={gosuIcon}
/>
Expand Down
2 changes: 1 addition & 1 deletion src/components/Visualizations/Graph/MatchGraph.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -101,7 +101,7 @@ const XpNetworthGraph = ({
<StyledDire>{strings.general_dire}</StyledDire>
<Heading
title={strings.heading_graph_difference}
buttonLabel={process.env.ENABLE_GOSUAI ? strings.gosu_default : null}
buttonLabel={process.env.REACT_APP_ENABLE_GOSUAI ? strings.gosu_default : null}
buttonTo={`${sponsorURL}Graphs`}
buttonIcon={sponsorIcon}
/>
Expand Down