Skip to content

Commit

Permalink
Merge pull request #152 from Say-Their-Name/development
Browse files Browse the repository at this point in the history
Fix news
  • Loading branch information
Easybuoy authored Jul 13, 2020
2 parents f37c77e + 88968d8 commit d016790
Show file tree
Hide file tree
Showing 5 changed files with 49 additions and 17 deletions.
7 changes: 6 additions & 1 deletion .env.example
Original file line number Diff line number Diff line change
Expand Up @@ -2,4 +2,9 @@
EXTEND_ESLINT=true
REACT_APP_API_BASE_URL=https://saytheirnames.dev/api
REACT_APP_GA_TRACKING_ID=GA_TRACKING_ID

REACT_APP_NEWS_FETCH_PROXY=REACT_APP_NEWS_FETCH_PROXY
REACT_APP_TWITTER_URL=REACT_APP_TWITTER_URL
REACT_APP_FACEBOOK_URL=REACT_APP_FACEBOOK_URL
REACT_APP_INSTAGRAM_URL=REACT_APP_INSTAGRAM_URL
REACT_APP_ANDROID_URL=REACT_APP_ANDROID_URL
REACT_APP_IOS_URL=REACT_APP_IOS_URL
24 changes: 14 additions & 10 deletions .github/workflows/unit-test.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -2,17 +2,21 @@ name: Unit Test Workflow

on:
pull_request:
branches: [ master, development ]
branches: [master, development]

jobs:
unit_test_pull_request:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- uses: actions/setup-node@v1
with:
node-version: 12
- name: Install Node Dependencies
run: yarn install --frozen-lockfile
- name: Run all Unit Tests
run: CI=true yarn test
steps:
- uses: actions/checkout@v2
- uses: actions/setup-node@v1
with:
node-version: 12
- name: Install Node Dependencies
run: yarn install --frozen-lockfile
- name: Run all Unit Tests
run: CI=true yarn test
env:
REACT_APP_TWITTER_URL: https://twitter.com/SayTheirName_io
REACT_APP_FACEBOOK_URL: https://www.facebook.com/Say-Their-Names-108926117523025/?modal=admin_todo_tour
REACT_APP_INSTAGRAM_URL: https://www.instagram.com/saytheirname.iocat
16 changes: 15 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
![Unit Test Workflow](https://github.com/Say-Their-Name/say-their-names-web/workflows/Unit%20Test%20Workflow/badge.svg)

# Say Their Names ✊🏿

## Overview
Expand Down Expand Up @@ -28,12 +30,24 @@ Using SSH:
```

### Navigate to app

```sh
cd say-their-names-web
```

### Add Environment Variable
Create a `.env` file in the root of the project and copy the contents of `.env.example` file to the newly created `.env` file.

Create a `.env` file in the root of the project and copy the contents below to the newly created `.env` file.

```
REACT_APP_API_BASE_URL=https://saytheirnames.dev/api
REACT_APP_NEWS_FETCH_PROXY=https://thingproxy.freeboard.io/fetch
REACT_APP_TWITTER_URL=https://twitter.com/SayTheirName_io
REACT_APP_FACEBOOK_URL=https://www.facebook.com/Say-Their-Names-108926117523025/?modal=admin_todo_tour
REACT_APP_INSTAGRAM_URL=https://www.instagram.com/saytheirname.io
REACT_APP_ANDROID_URL=https://play.google.com/store/apps/details?id=io.saytheirnames.android
REACT_APP_IOS_URL=https://apps.apple.com/app/say-their-names/id1517599626
```

### Installing Dependencies

Expand Down
1 change: 1 addition & 0 deletions src/components/ui/news/News.js
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@ const News = ({ news }) => {
minLine={1}
url={news.url}
loadSecureUrl
proxyUrl={process.env.REACT_APP_NEWS_FETCH_PROXY}
onSuccess={() => setDisplay('block')}
onError={() => setDisplay('none')}
/>
Expand Down
18 changes: 13 additions & 5 deletions src/constants/Variables.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,15 @@
const {
REACT_APP_TWITTER_URL,
REACT_APP_FACEBOOK_URL,
REACT_APP_INSTAGRAM_URL,
REACT_APP_ANDROID_URL,
REACT_APP_IOS_URL
} = process.env;

export default {
TWITTER_URL: 'https://twitter.com/SayTheirName_io',
FACEBOOK_URL: 'https://www.facebook.com/Say-Their-Names-108926117523025/?modal=admin_todo_tour',
INSTAGRAM_URL: 'https://www.instagram.com/saytheirname.io/',
ANDROID_URL: '#',
IOS_URL: 'https://apps.apple.com/app/say-their-names/id1517599626'
TWITTER_URL: REACT_APP_TWITTER_URL,
FACEBOOK_URL: REACT_APP_FACEBOOK_URL,
INSTAGRAM_URL: REACT_APP_INSTAGRAM_URL,
ANDROID_URL: REACT_APP_ANDROID_URL,
IOS_URL: REACT_APP_IOS_URL
};

0 comments on commit d016790

Please sign in to comment.