Compare commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
cc834a7a16 | ||
|
|
b59a4e6432 | ||
|
|
6f68884db7 | ||
|
|
0cd23ab88a | ||
|
|
3be41f0e3c | ||
|
|
6938e62b93 | ||
|
|
15e16786a7 | ||
|
|
fe27f54320 | ||
|
|
f222cc2ee8 | ||
|
|
f3739f3c5f | ||
|
|
f89315e91a | ||
|
|
0e16b1f924 | ||
|
|
a3c7e3370e | ||
|
|
fd396cbd3a | ||
|
|
d44445a7cc | ||
|
|
c79d9e32cc | ||
|
|
ab120feeed | ||
|
|
8fc7cf0f88 | ||
|
|
34fe923f50 | ||
|
|
5de8cf03c1 | ||
|
|
ddda0fa080 | ||
|
|
73cf3067c3 | ||
|
|
4cf63588c7 | ||
|
|
58c7644ad4 | ||
|
|
701c8c518a | ||
|
|
d6ec90d4f3 | ||
|
|
ddd682ca3b | ||
|
|
b1298b9033 | ||
|
|
418ba58d3c | ||
|
|
a36080994a | ||
|
|
911f316743 | ||
|
|
70baf983ac | ||
|
|
5d6c78bcc8 | ||
|
|
d333b22ea3 | ||
|
|
1f88cfa439 | ||
|
|
84cd3dc2d3 | ||
|
|
4a14e822a5 | ||
|
|
734c586b10 | ||
|
|
4955faaa63 | ||
|
|
b6e7c3b2e2 | ||
|
|
18e45eab64 | ||
|
|
18796c82fd | ||
|
|
63a007f766 | ||
|
|
db37cf4fdf | ||
|
|
4ae243fcf7 | ||
|
|
2ba447ad02 | ||
|
|
8f96def584 | ||
|
|
b0ac4bbc35 | ||
|
|
8f9f1f7b9c | ||
|
|
f2dd3ba7e2 | ||
|
|
960dc4aa96 | ||
|
|
4c447ce5b6 | ||
|
|
f7dc589511 | ||
|
|
beb3fee101 | ||
|
|
f62d228cdf | ||
|
|
a512db2520 | ||
|
|
4519fcca11 | ||
|
|
f0f925bd2a | ||
|
|
53de27ff9f | ||
|
|
b008d5cdee | ||
|
|
f07dfbf5da | ||
|
|
8d9f4ae492 | ||
|
|
16726969cf | ||
|
|
93430f7548 | ||
|
|
fd3090b2f1 | ||
|
|
5ab7de4924 | ||
|
|
ef9d5cd39b | ||
|
|
17d804c53b | ||
|
|
12fcae97a6 | ||
|
|
e183226b89 | ||
|
|
8f4731368a | ||
|
|
b322452569 | ||
|
|
437d94cd29 | ||
|
|
6600641ba4 | ||
|
|
0d2100ee1e | ||
|
|
ada339d871 | ||
|
|
3f6c33f7ca | ||
|
|
3e5377868c | ||
|
|
880b0c7b55 | ||
|
|
710b525f11 | ||
|
|
567e48da31 | ||
|
|
34d1014b7d | ||
|
|
9853a0bff0 | ||
|
|
38ea00bd8d | ||
|
|
579f804003 | ||
|
|
f0c2e69c5b | ||
|
|
74f8756d9f | ||
|
|
42f1a3f746 | ||
|
|
0ecef37b87 | ||
|
|
ca425d6d0a | ||
|
|
f06a2d974f | ||
|
|
8157e2f0bc | ||
|
|
081e934b8c | ||
|
|
8365b0e2e8 | ||
|
|
a2699819bf | ||
|
|
89518b8a1f | ||
|
|
b26ae3a17c | ||
|
|
eedf08647a | ||
|
|
b766c949f2 | ||
|
|
22abf3e62f | ||
|
|
a3264e4207 | ||
|
|
27fe30226a | ||
|
|
a791f9fcbd | ||
|
|
de511c9ba4 | ||
|
|
2160fbf771 | ||
|
|
6fdd652fa4 | ||
|
|
891be1862b | ||
|
|
d47963acc2 | ||
|
|
b6318ae554 | ||
|
|
42457bc6d5 | ||
|
|
b1b713eecd | ||
|
|
161b32d830 | ||
|
|
e5b8cb2be7 | ||
|
|
33faae70a6 | ||
|
|
ce19cf5b7b | ||
|
|
cebd668629 | ||
|
|
eddaf899d9 | ||
|
|
1e1f20da5e | ||
|
|
9b8a3f3597 | ||
|
|
69d06fc4ec | ||
|
|
7beeb69abd | ||
|
|
f223bbb1ed | ||
|
|
9a60a4f707 | ||
|
|
2209553e25 | ||
|
|
e57366cd31 | ||
|
|
8479b9e08b | ||
|
|
32ef4887fa | ||
|
|
b365432c57 | ||
|
|
28cfa48117 | ||
|
|
43e34e2f37 |
No files matched your search
@@ -2,4 +2,6 @@
|
||||
API_KEY=ABC
|
||||
API_SECRET=ABC
|
||||
# This is the port that the UI server starts on
|
||||
SERVER_PORT=5001
|
||||
PORT=5001
|
||||
# this can be 'development' or 'production'
|
||||
NODE_ENV=development
|
||||
@@ -11,4 +11,7 @@ venv.bak/
|
||||
|
||||
.DS_Store
|
||||
.vscode
|
||||
.idea
|
||||
.idea
|
||||
|
||||
*.log
|
||||
www
|
||||
@@ -0,0 +1,21 @@
|
||||
MIT License
|
||||
|
||||
Copyright (c) 2020 Podcastindex.org
|
||||
|
||||
Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||
of this software and associated documentation files (the "Software"), to deal
|
||||
in the Software without restriction, including without limitation the rights
|
||||
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
||||
copies of the Software, and to permit persons to whom the Software is
|
||||
furnished to do so, subject to the following conditions:
|
||||
|
||||
The above copyright notice and this permission notice shall be included in all
|
||||
copies or substantial portions of the Software.
|
||||
|
||||
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
||||
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
||||
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
||||
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
||||
SOFTWARE.
|
||||
@@ -1,6 +1,41 @@
|
||||
# PodcastIndex web and dev UI
|
||||
# PodcastIndex Web UI
|
||||
|
||||
This is the UI for the public and dev portal
|
||||
Podcast Web UI is a project that houses the code for the React app and express server for [podcastindex.org](https://podcastindex.org/).
|
||||
|
||||
- Landing page for PodcastIndex.
|
||||
- Search for podcasts in index.
|
||||
- Simple podcast player for listening
|
||||
- List of apps using the PodcastIndex
|
||||
- Documentation and developer login for credential management
|
||||
|
||||
## Project Structure
|
||||
|
||||
The project is split into two folders, `ui`, and `server`.
|
||||
|
||||
.
|
||||
├── ...
|
||||
├── ui
|
||||
│ ├── public # Static files for index.html and favicon
|
||||
│ ├── fonts # Fonts used in the UI
|
||||
│ ├── images # Images and icons that are part of the UI
|
||||
│ └── src # All React and client code
|
||||
├── server
|
||||
│ ├── assets # static files that are dynamically updated
|
||||
│ ├── data # static data files (ie. json) that are dynamically updated
|
||||
│ └── index.js # express app that serves the UI and is a reverse proxy (replaces need for NGINX)
|
||||
└── ...
|
||||
|
||||
The folder `ui` houses all the React and client based code and assets.
|
||||
|
||||
The folder `server` houses all of the API, static server data, and the reverse proxy to the PodcastIndex API using [`comster/podcast-index-api`](https://github.com/comster/podcast-index-api).
|
||||
|
||||
### Server `data` and `assets`
|
||||
|
||||
The reason to build a custom express server for serving React and other data is due to the need for script updated `.json` files and dynamically adding apps to the `/apps` page. This data should not be bundled with the client compiled code.
|
||||
|
||||
### CORS
|
||||
|
||||
The custom express server also is used to [reverse proxy](https://en.wikipedia.org/wiki/Reverse_proxy#:~:text=In%20computer%20networks%2C%20a%20reverse,the%20reverse%20proxy%20server%20itself.) requests through the same domain to prevent [CORS](https://developer.mozilla.org/en-US/docs/Web/HTTP/CORS) issues. Using the same domain to server up the UI content and to send api requests prevents CORS issues in modern browsers.
|
||||
|
||||
## Getting Started
|
||||
|
||||
@@ -10,33 +45,40 @@ You should see a `.env-example` file. Copy this and remove the `-example`. The f
|
||||
|
||||
### Starting the dev server
|
||||
|
||||
In order to have the UI hot reload for development, we utilized `webpack-dev-server` this allows for easier debugging, etc. In order for the dev-server to connect to the API, you must first have set the `.env` file variables and have started the server with `node server.js`
|
||||
|
||||
```zsh
|
||||
# Install dependencies
|
||||
yarn
|
||||
npm install
|
||||
|
||||
# Start app
|
||||
yarn start
|
||||
# Start dev server
|
||||
npm run dev
|
||||
|
||||
# Start the node server in another terminal window.
|
||||
node server
|
||||
```
|
||||
|
||||
## Building for production
|
||||
|
||||
To build the app for production use the following script.
|
||||
|
||||
```zsh
|
||||
yarn build
|
||||
```
|
||||
|
||||
This will compile the React code into static files in the `www` folder
|
||||
|
||||
## Running production
|
||||
|
||||
To start the server, simply run after setting the `.env` file
|
||||
|
||||
**Note**: Make sure to set `NODE_ENV=production` in the `.env` file
|
||||
|
||||
The below script will compile the code and then start the node server.
|
||||
|
||||
```zsh
|
||||
node server.js
|
||||
npm run build
|
||||
npm start
|
||||
```
|
||||
|
||||
## Tech List
|
||||
|
||||
- [Express](https://expressjs.com/)
|
||||
- [React](https://reactjs.org/)
|
||||
- [Webpack](https://webpack.js.org/)
|
||||
|
||||
## TODO
|
||||
|
||||
- Font should load through webpack properly
|
||||
- Better image loading handling in the search results page.
|
||||
- Developers page and login
|
||||
@@ -1,11 +0,0 @@
|
||||
|
||||
<svg width="31px" height="30px" viewBox="0 0 31 30" version="1.1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink">
|
||||
<g stroke="none" stroke-width="1" fill="none" fill-rule="evenodd">
|
||||
<g transform="translate(-1176.000000, -742.000000)">
|
||||
<g transform="translate(1176.000000, 742.000000)">
|
||||
<rect fill="#B1B1B1" x="0" y="0" width="31" height="30" rx="7"></rect>
|
||||
<path d="M7.82692308,20.3461538 C6.26646154,20.3461538 5,21.6126154 5,23.1730769 C5,24.7335385 6.26646154,26 7.82692308,26 C9.38738462,26 10.6538462,24.7335385 10.6538462,23.1730769 C10.6538462,21.6126154 9.38738462,20.3461538 7.82692308,20.3461538 Z M9.24038462,14.6923077 C8.68509615,14.6923077 8.23076923,15.1466346 8.23076923,15.7019231 C8.23076923,16.2572115 8.68509615,16.7115385 9.24038462,16.7115385 C12.0269231,16.7115385 14.2884615,18.9730769 14.2884615,21.7596154 C14.2884615,22.3149038 14.7427885,22.7692308 15.2980769,22.7692308 C15.8533654,22.7692308 16.3076923,22.3149038 16.3076923,21.7596154 C16.3076923,17.8524038 13.1475962,14.6923077 9.24038462,14.6923077 Z M9.21794872,5 C8.675,5 8.23076923,5.44423077 8.23076923,5.98717949 C8.23076923,6.53012821 8.675,6.97435897 9.21794872,6.97435897 C17.3917949,6.97435897 24.025641,13.6082051 24.025641,21.7820513 C24.025641,22.325 24.4698718,22.7692308 25.0128205,22.7692308 C25.5557692,22.7692308 26,22.325 26,21.7820513 C26,12.5124359 18.4875641,5 9.21794872,5 Z M9.22485207,9.84615385 C8.67810651,9.84615385 8.23076923,10.2934911 8.23076923,10.8402367 C8.23076923,11.3869822 8.67810651,11.8343195 9.22485207,11.8343195 C14.7121893,11.8343195 19.1656805,16.2878107 19.1656805,21.7751479 C19.1656805,22.3218935 19.6130178,22.7692308 20.1597633,22.7692308 C20.7065089,22.7692308 21.1538462,22.3218935 21.1538462,21.7751479 C21.1538462,15.1843787 15.8156213,9.84615385 9.22485207,9.84615385 Z" id="Shape" fill="#FFFFFF"></path>
|
||||
</g>
|
||||
</g>
|
||||
</g>
|
||||
</svg>
|
||||
|
Before Width: | Height: | Size: 1.9 KiB |
@@ -1,12 +0,0 @@
|
||||
|
||||
<svg width="28px" height="29px" viewBox="0 0 28 29" version="1.1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink">
|
||||
<g stroke="none" stroke-width="1" fill="none" fill-rule="evenodd">
|
||||
<g transform="translate(-25.000000, -24.000000)" fill="#F90000">
|
||||
<g transform="translate(25.000000, 23.000000)">
|
||||
<rect id="Rectangle" x="12.5" y="11" width="3" height="19" rx="1.5"></rect>
|
||||
<path d="M7.59979894,16.3285714 C4.35694178,13.2428571 4.62837035,8.45714282 7.61408465,5.67142852 C8.18551323,5.14285709 9.09979895,5.17142852 9.61408466,5.75714281 C10.1569418,6.32857138 10.1140847,7.22857138 9.54265609,7.77142853 C7.72837037,9.47142854 7.5569418,12.3571428 9.55694181,14.2571428 C10.1283704,14.8 10.1569418,15.7 9.61408466,16.2714286 C9.07122752,16.8428571 8.17122751,16.8714286 7.59979894,16.3285714 Z M6.59911452,18.4285714 C7.31340024,18.8571429 7.45625738,19.7142857 6.88482881,20.4285715 C6.59911452,20.8571429 6.17054309,21 5.74197166,21 C5.45625737,21 5.17054308,20.8571429 4.8848288,20.7142857 C2.02768593,18.5714286 0.170543059,14.8571429 0.0276859151,11 C-0.115171228,6.99999996 1.74197164,3.71428565 4.8848288,1.28571421 C5.45625737,0.857142781 6.45625738,0.857142781 6.88482881,1.5714285 C7.31340024,2.14285707 7.31340024,3.14285708 6.59911452,3.57142851 C4.17054308,5.42857138 2.88482879,7.99999996 2.88482879,11 C2.88482879,13.8571428 4.31340022,16.8571429 6.59911452,18.4285714 Z M18.3975265,16.2714286 C17.8546694,15.7 17.8832408,14.8 18.4403837,14.2428571 C20.4403837,12.3428571 20.2832408,9.45714282 18.4546694,7.75714282 C17.8832408,7.22857138 17.8403837,6.31428567 18.3832408,5.74285709 C18.9118122,5.17142852 19.8260979,5.12857137 20.3975265,5.67142852 C23.3832408,8.45714282 23.6546694,13.2428571 20.4118122,16.3285714 C19.8403837,16.8714286 18.9403837,16.8428571 18.3975265,16.2714286 Z M23.132597,1.28571421 C26.2754542,3.71428565 28.1183113,6.99999996 27.9897399,11 C27.9897399,14.8571429 26.1325971,18.5714286 23.132597,20.7142857 C22.8468828,20.8571429 22.5611685,21 22.2754542,21 C21.8468827,21 21.4183113,20.8571429 21.132597,20.4285715 C20.5611685,19.7142857 20.7040256,18.8571429 21.4183113,18.4285714 C23.7040256,16.8571429 25.132597,13.8571428 25.132597,11 C25.132597,7.99999996 23.8468828,5.42857138 21.4183113,3.57142851 C20.7040256,3.14285708 20.7040256,2.14285707 21.132597,1.5714285 C21.5611685,0.857142781 22.5611685,0.857142781 23.132597,1.28571421 Z" id="Shape"></path>
|
||||
<circle id="Oval" cx="14" cy="11" r="3"></circle>
|
||||
</g>
|
||||
</g>
|
||||
</g>
|
||||
</svg>
|
||||
|
Before Width: | Height: | Size: 2.5 KiB |
@@ -1,74 +1,79 @@
|
||||
{
|
||||
"name": "podcastindex",
|
||||
"version": "0.1.0",
|
||||
"private": true,
|
||||
"dependencies": {
|
||||
"@types/history": "^4.7.5",
|
||||
"@types/react": "^16.9.20",
|
||||
"@types/react-dom": "^16.9.5",
|
||||
"@types/react-redux": "^7.1.7",
|
||||
"@types/react-router-dom": "^5.1.3",
|
||||
"@types/redux": "^3.6.0",
|
||||
"@types/redux-actions": "^2.6.1",
|
||||
"@types/redux-thunk": "^2.1.0",
|
||||
"apexcharts": "^3.20.0",
|
||||
"connected-react-router": "^6.7.0",
|
||||
"dotenv": "^8.2.0",
|
||||
"express": "^4.17.1",
|
||||
"history": "^4.10.1",
|
||||
"moment": "^2.29.0",
|
||||
"pluralize": "^8.0.0",
|
||||
"podcast-index-api": "^1.1.6",
|
||||
"react": "^16.12.0",
|
||||
"react-dom": "^16.12.0",
|
||||
"react-h5-audio-player": "^3.4.1",
|
||||
"react-list": "^0.8.15",
|
||||
"react-loading": "^2.0.3",
|
||||
"react-redux": "^7.2.0",
|
||||
"react-router-dom": "^5.1.2",
|
||||
"redux": "^4.0.5",
|
||||
"redux-actions": "^2.6.5",
|
||||
"redux-devtools-extension": "^2.13.8",
|
||||
"redux-thunk": "^2.3.0",
|
||||
"reduxsauce": "^1.1.2",
|
||||
"shortid": "^2.2.15",
|
||||
"typesafe-actions": "^5.1.0"
|
||||
},
|
||||
"devDependencies": {
|
||||
"@babel/core": "^7.11.6",
|
||||
"@storybook/addon-actions": "^6.0.21",
|
||||
"@storybook/addon-essentials": "^6.0.21",
|
||||
"@storybook/addon-links": "^6.0.21",
|
||||
"@storybook/node-logger": "^6.0.21",
|
||||
"@storybook/preset-create-react-app": "^3.1.4",
|
||||
"@storybook/react": "^6.0.21",
|
||||
"babel-loader": "^8.1.0",
|
||||
"css-loader": "^3.4.2",
|
||||
"favicons-webpack-plugin": "^4.2.0",
|
||||
"file-loader": "^6.1.0",
|
||||
"html-loader": "^0.5.5",
|
||||
"html-webpack-plugin": "^4.5.0",
|
||||
"prettier": "^2.1.1",
|
||||
"react-is": "^16.13.1",
|
||||
"react-scripts": "3.2.0",
|
||||
"sass": "^1.26.10",
|
||||
"sass-loader": "^9.0.3",
|
||||
"style-loader": "^1.1.3",
|
||||
"ts-loader": "^6.2.1",
|
||||
"typescript": "^3.7.5",
|
||||
"url-loader": "^4.1.0",
|
||||
"webpack": "^4.41.6",
|
||||
"webpack-cli": "^3.3.11",
|
||||
"webpack-dev-server": "^3.10.3"
|
||||
},
|
||||
"scripts": {
|
||||
"start": "webpack-dev-server",
|
||||
"build": "webpack",
|
||||
"test": "react-scripts test --env=jsdom",
|
||||
"eject": "react-scripts eject",
|
||||
"flow": "flow",
|
||||
"format": "prettier --write 'src/**/*.js'",
|
||||
"storybook": "start-storybook -p 6006 -s public",
|
||||
"build-storybook": "build-storybook -s public"
|
||||
}
|
||||
"name": "podcastindex",
|
||||
"version": "0.2.0",
|
||||
"license": "MIT",
|
||||
"private": true,
|
||||
"dependencies": {
|
||||
"@types/history": "^4.7.5",
|
||||
"@types/react": "^16.9.20",
|
||||
"@types/react-dom": "^16.9.5",
|
||||
"@types/react-redux": "^7.1.7",
|
||||
"@types/react-router-dom": "^5.1.3",
|
||||
"@types/redux": "^3.6.0",
|
||||
"@types/redux-actions": "^2.6.1",
|
||||
"@types/redux-thunk": "^2.1.0",
|
||||
"apexcharts": "^3.20.0",
|
||||
"connected-react-router": "^6.7.0",
|
||||
"dotenv": "^8.2.0",
|
||||
"express": "^4.17.1",
|
||||
"history": "^4.10.1",
|
||||
"moment": "^2.29.0",
|
||||
"pluralize": "^8.0.0",
|
||||
"podcast-index-api": "^1.1.6",
|
||||
"query-string": "^6.13.5",
|
||||
"react": "^16.12.0",
|
||||
"react-dom": "^16.12.0",
|
||||
"react-h5-audio-player": "^3.4.1",
|
||||
"react-list": "^0.8.15",
|
||||
"react-loading": "^2.0.3",
|
||||
"react-redux": "^7.2.0",
|
||||
"react-router-dom": "^5.1.2",
|
||||
"redux": "^4.0.5",
|
||||
"redux-actions": "^2.6.5",
|
||||
"redux-devtools-extension": "^2.13.8",
|
||||
"redux-thunk": "^2.3.0",
|
||||
"reduxsauce": "^1.1.2",
|
||||
"shortid": "^2.2.15",
|
||||
"typesafe-actions": "^5.1.0"
|
||||
},
|
||||
"devDependencies": {
|
||||
"@babel/core": "^7.11.6",
|
||||
"@storybook/addon-actions": "^6.0.21",
|
||||
"@storybook/addon-essentials": "^6.0.21",
|
||||
"@storybook/addon-links": "^6.0.21",
|
||||
"@storybook/node-logger": "^6.0.21",
|
||||
"@storybook/preset-create-react-app": "^3.1.4",
|
||||
"@storybook/react": "^6.0.21",
|
||||
"babel-loader": "^8.1.0",
|
||||
"copy-webpack-plugin": "^6.3.2",
|
||||
"css-loader": "^3.4.2",
|
||||
"favicons-webpack-plugin": "^4.2.0",
|
||||
"file-loader": "^6.1.0",
|
||||
"html-loader": "^0.5.5",
|
||||
"html-webpack-plugin": "^4.5.0",
|
||||
"prettier": "^2.1.1",
|
||||
"react-is": "^16.13.1",
|
||||
"react-scripts": "3.2.0",
|
||||
"sass": "^1.26.10",
|
||||
"sass-loader": "^9.0.3",
|
||||
"style-loader": "^1.1.3",
|
||||
"ts-loader": "^6.2.1",
|
||||
"typescript": "^3.7.5",
|
||||
"url-loader": "^4.1.0",
|
||||
"webpack": "^4.41.6",
|
||||
"webpack-cli": "^3.3.11",
|
||||
"webpack-dev-server": "^3.10.3"
|
||||
},
|
||||
"scripts": {
|
||||
"dev": "webpack-dev-server",
|
||||
"build": "webpack",
|
||||
"production": "NODE_ENV='production' && webpack && node server",
|
||||
"start": "node server",
|
||||
"test": "react-scripts test --env=jsdom",
|
||||
"eject": "react-scripts eject",
|
||||
"flow": "flow",
|
||||
"format": "prettier --write 'src/**/*.js'",
|
||||
"storybook": "start-storybook -p 6006 -s public",
|
||||
"build-storybook": "build-storybook -s public"
|
||||
}
|
||||
}
|
||||
|
Before Width: | Height: | Size: 894 B |
@@ -1,33 +0,0 @@
|
||||
const path = require('path')
|
||||
const express = require('express')
|
||||
const app = express() // create express app
|
||||
// Gets the .env variables
|
||||
require('dotenv').config()
|
||||
|
||||
// Utilizing the node repo from comster/podcast-index-api :)
|
||||
// NOTE: This server will work as a reverse proxy.
|
||||
const api = require('podcast-index-api')(
|
||||
process.env.API_KEY,
|
||||
process.env.API_SECRET
|
||||
)
|
||||
|
||||
app.use(express.static('www'))
|
||||
|
||||
app.use('/api/search/byterm', async (req, res) => {
|
||||
let term = req.query.q
|
||||
const response = await api.searchByTerm(term)
|
||||
res.send(response)
|
||||
})
|
||||
|
||||
app.use('/api/recent/episodes', async (req, res) => {
|
||||
let max = req.query.max
|
||||
const response = await api.recentEpisodes(max)
|
||||
res.send(response)
|
||||
})
|
||||
|
||||
app.get('*', (req, res) => res.sendFile(path.resolve('www', 'index.html')))
|
||||
|
||||
// start express server on port 5001 (default)
|
||||
app.listen(process.env.SERVER_PORT, () => {
|
||||
console.log(`server started on port ${process.env.SERVER_PORT}`)
|
||||
})
|
||||
|
After Width: | Height: | Size: 69 KiB |
|
After Width: | Height: | Size: 3.0 KiB |
|
After Width: | Height: | Size: 14 KiB |
|
After Width: | Height: | Size: 86 KiB |
|
After Width: | Height: | Size: 41 KiB |
|
After Width: | Height: | Size: 18 KiB |
|
After Width: | Height: | Size: 10 KiB |
|
After Width: | Height: | Size: 10 KiB |
|
After Width: | Height: | Size: 42 KiB |
|
After Width: | Height: | Size: 12 KiB |
|
After Width: | Height: | Size: 17 KiB |
|
After Width: | Height: | Size: 8.3 KiB |
|
After Width: | Height: | Size: 9.2 KiB |
|
After Width: | Height: | Size: 9.9 KiB |
|
After Width: | Height: | Size: 10 KiB |
|
After Width: | Height: | Size: 7.1 KiB |
|
After Width: | Height: | Size: 8.9 KiB |
@@ -0,0 +1,359 @@
|
||||
[
|
||||
{
|
||||
"appName": "Buzzsprout",
|
||||
"appType": "hosting",
|
||||
"appUrl": "https://www.buzzsprout.com",
|
||||
"appIconUrl": "buzzsprout.png",
|
||||
"platforms": ["N/A"],
|
||||
"supportedElements": [
|
||||
{
|
||||
"elementName": "Transcript",
|
||||
"elementURL": "https://www.buzzsprout.com/blog/transcription-tools"
|
||||
},
|
||||
{
|
||||
"elementName": "Locked",
|
||||
"elementURL": "https://www.buzzsprout.com/blog/podcast-locking"
|
||||
},
|
||||
{
|
||||
"elementName": "Funding",
|
||||
"elementURL": "https://www.buzzsprout.com/"
|
||||
},
|
||||
{
|
||||
"elementName": "Chapters",
|
||||
"elementURL": "https://twitter.com/buzzsprout/status/1324425781330796545"
|
||||
},
|
||||
{
|
||||
"elementName": "Soundbite",
|
||||
"elementURL": "https://www.buzzsprout.com/"
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
"appName": "Podfriend",
|
||||
"appType": "app",
|
||||
"appUrl": "https://www.podfriend.com",
|
||||
"appIconUrl": "podfriend.jpg",
|
||||
"platforms": ["Windows", "Web"],
|
||||
"supportedElements": [
|
||||
{
|
||||
"elementName": "Transcript",
|
||||
"elementURL": "https://twitter.com/GoPodfriend/status/1316847938828742656"
|
||||
},
|
||||
{
|
||||
"elementName": "Funding",
|
||||
"elementURL": "https://twitter.com/GoPodfriend/status/1318663369684123648"
|
||||
},
|
||||
{
|
||||
"elementName": "Chapters",
|
||||
"elementURL": "https://twitter.com/adamcurry/status/1323417144378445831"
|
||||
},
|
||||
{
|
||||
"elementName": "Search",
|
||||
"elementURL": "https://twitter.com/GoPodfriend/status/1316847938828742656"
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
"appName": "Podverse",
|
||||
"appType": "app",
|
||||
"appUrl": "https://podverse.fm",
|
||||
"appIconUrl": "podverse.jpg",
|
||||
"platforms": ["iOS", "Android", "Web"],
|
||||
"supportedElements": [
|
||||
{
|
||||
"elementName": "Funding",
|
||||
"elementURL": "https://twitter.com/Podverse/status/1325734448608899072?s=20"
|
||||
},
|
||||
{
|
||||
"elementName": "Chapters",
|
||||
"elementURL": "https://twitter.com/Podverse/status/1324729288281632771?s=20"
|
||||
},
|
||||
{
|
||||
"elementName": "Soundbite",
|
||||
"elementURL": "https://twitter.com/Podverse/status/1326072379597053953?s=20"
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
"appName": "Podcast Addict",
|
||||
"appType": "app",
|
||||
"appUrl": "https://podcastaddict.com",
|
||||
"appIconUrl": "podcastaddict.png",
|
||||
"platforms": ["Android", "Web"],
|
||||
"supportedElements": [
|
||||
{
|
||||
"elementName": "Transcript",
|
||||
"elementURL": "https://podcastaddict.com/changelog/2020_14#section1"
|
||||
},
|
||||
{
|
||||
"elementName": "Chapters",
|
||||
"elementURL": "https://podcastaddict.com/changelog/2020_16#section4"
|
||||
},
|
||||
{
|
||||
"elementName": "Search",
|
||||
"elementURL": "https://twitter.com/PodcastAddict/status/1319645267335933954"
|
||||
},
|
||||
{
|
||||
"elementName": "Funding",
|
||||
"elementURL": "https://twitter.com/PodcastAddict/status/1319645267335933954"
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
"appName": "Podnews",
|
||||
"appType": "news / directory",
|
||||
"appUrl": "https://podnews.net",
|
||||
"appIconUrl": "podnews.jpg",
|
||||
"platforms": ["Email"],
|
||||
"supportedElements": [
|
||||
{
|
||||
"elementName": "Transcript",
|
||||
"elementURL": "https://podnews.net/rss"
|
||||
},
|
||||
{
|
||||
"elementName": "Locked",
|
||||
"elementURL": "https://podnews.net/rss"
|
||||
},
|
||||
{
|
||||
"elementName": "Search",
|
||||
"elementURL": "https://podnews.net"
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
"appName": "Podcastindex",
|
||||
"appType": "directory",
|
||||
"appUrl": "https://podcastindex.org",
|
||||
"appIconUrl": "podcastindex.jpg",
|
||||
"platforms": ["N/A"],
|
||||
"supportedElements": [
|
||||
{
|
||||
"elementName": "Transcript",
|
||||
"elementURL": "https://podcastindex.org"
|
||||
},
|
||||
{
|
||||
"elementName": "Locked",
|
||||
"elementURL": "https://podcastindex.org"
|
||||
},
|
||||
{
|
||||
"elementName": "Funding",
|
||||
"elementURL": "https://podcastindex.org"
|
||||
},
|
||||
{
|
||||
"elementName": "Chapters",
|
||||
"elementURL": "https://podcastindex.org"
|
||||
},
|
||||
{
|
||||
"elementName": "Soundbite",
|
||||
"elementURL": "https://podcastindex.org"
|
||||
},
|
||||
{
|
||||
"elementName": "Value",
|
||||
"elementURL": "https://podcastindex.org"
|
||||
},
|
||||
{
|
||||
"elementName": "Search",
|
||||
"elementURL": "https://podcastindex.org"
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
"appName": "podStation",
|
||||
"appType": "browser extension",
|
||||
"appUrl": "https://chrome.google.com/webstore/detail/podstation-podcast-player/bpcagekijmfcocgjlnnhpdogbplajjfn",
|
||||
"appIconUrl": "podstation.jpg",
|
||||
"platforms": ["Chrome"],
|
||||
"supportedElements": [
|
||||
{
|
||||
"elementName": "Funding",
|
||||
"elementURL": "https://chrome.google.com/webstore/detail/podstation-podcast-player/bpcagekijmfcocgjlnnhpdogbplajjfn"
|
||||
},
|
||||
{
|
||||
"elementName": "Search",
|
||||
"elementURL": "https://twitter.com/podStation_app/status/1309164054829826048"
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
"appName": "Podcast Chapters",
|
||||
"appType": "app",
|
||||
"appUrl": "https://chaptersapp.com",
|
||||
"appIconUrl": "chaptersapp.jpg",
|
||||
"platforms": ["macOS"],
|
||||
"supportedElements": [
|
||||
{
|
||||
"elementName": "Chapters",
|
||||
"elementURL": "https://chaptersapp.com/faq/jsonExport.html"
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
"appName": "Hypercatcher",
|
||||
"appType": "app",
|
||||
"appUrl": "https://hypercatcher.com",
|
||||
"appIconUrl": "hypercatcher.jpg",
|
||||
"platforms": ["iOS"],
|
||||
"supportedElements": [
|
||||
{
|
||||
"elementName": "Chapters",
|
||||
"elementURL": "https://hypercatcher.com/2020/11/how-to-create-podcast-chapters-as-a-listener/"
|
||||
},
|
||||
{
|
||||
"elementName": "Search",
|
||||
"elementURL": "https://hypercatcher.com"
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
"appName": "Castopod",
|
||||
"appType": "hosting",
|
||||
"appUrl": "https://castopod.org/",
|
||||
"appIconUrl": "castopod.png",
|
||||
"platforms": ["N/A"],
|
||||
"supportedElements": [
|
||||
{
|
||||
"elementName": "Locked",
|
||||
"elementURL": "https://podlibre.org/castopod-supports-podcast-locking/"
|
||||
},
|
||||
{
|
||||
"elementName": "Funding",
|
||||
"elementURL": "https://podlibre.org/publish-your-podcast-on-all-platforms/#podcastindex"
|
||||
},
|
||||
{
|
||||
"elementName": "Transcript",
|
||||
"elementURL": "https://podlibre.org/castopod-supports-chapters-and-transcript-tags/"
|
||||
},
|
||||
{
|
||||
"elementName": "Chapters",
|
||||
"elementURL": "https://podlibre.org/castopod-supports-chapters-and-transcript-tags/"
|
||||
},
|
||||
{
|
||||
"elementName": "Soundbite",
|
||||
"elementURL": "https://podlibre.org/castopod-supports-soundbite-tag/"
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
"appName": "Fireside",
|
||||
"appType": "hosting",
|
||||
"appUrl": "https://fireside.fm",
|
||||
"appIconUrl": "fireside.jpg",
|
||||
"platforms": ["N/A"],
|
||||
"supportedElements": [
|
||||
{
|
||||
"elementName": "Transcript",
|
||||
"elementURL": "https://twitter.com/firesidefm/status/1318970082891075590"
|
||||
},
|
||||
{
|
||||
"elementName": "Locked",
|
||||
"elementURL": "https://twitter.com/firesidefm/status/1318970082891075590"
|
||||
},
|
||||
{
|
||||
"elementName": "Funding",
|
||||
"elementURL": "https://twitter.com/firesidefm/status/1318970082891075590"
|
||||
},
|
||||
{
|
||||
"elementName": "Chapters",
|
||||
"elementURL": "https://twitter.com/firesidefm/status/1318970082891075590"
|
||||
},
|
||||
{
|
||||
"elementName": "Soundbite",
|
||||
"elementURL": "https://twitter.com/firesidefm/status/1318970082891075590"
|
||||
},
|
||||
{
|
||||
"elementName": "Person",
|
||||
"elementURL": "https://twitter.com/firesidefm/status/1318970082891075590"
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
"appName": "Transistor",
|
||||
"appType": "hosting",
|
||||
"appUrl": "https://transistor.fm",
|
||||
"appIconUrl": "transistor.jpg",
|
||||
"platforms": ["N/A"],
|
||||
"supportedElements": [
|
||||
{
|
||||
"elementName": "Locked",
|
||||
"elementURL": "https://twitter.com/transistorfm"
|
||||
},
|
||||
{
|
||||
"elementName": "Funding",
|
||||
"elementURL": "https://twitter.com/transistorfm"
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
"appName": "PodServe",
|
||||
"appType": "hosting",
|
||||
"appUrl": "https://podserve.fm",
|
||||
"appIconUrl": "podserve.png",
|
||||
"platforms": ["N/A"],
|
||||
"supportedElements": [
|
||||
{
|
||||
"elementName": "Locked",
|
||||
"elementURL": "https://twitter.com/PodServeFM/status/1329960334967226373"
|
||||
},
|
||||
{
|
||||
"elementName": "Funding",
|
||||
"elementURL": "https://twitter.com/PodServeFM/status/1329960334967226373"
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
"appName": "Podcast GURU",
|
||||
"appType": "app",
|
||||
"appUrl": "https://podcastguru.io",
|
||||
"appIconUrl": "podcastguru.jpg",
|
||||
"platforms": ["Android", "Web"],
|
||||
"supportedElements": [
|
||||
{
|
||||
"elementName": "Search",
|
||||
"elementURL": "https://twitter.com/podcastguru_app/status/1325834426346041347"
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
"appName": "Sphinx.chat",
|
||||
"appType": "app",
|
||||
"appUrl": "https://sphinx.chat",
|
||||
"appIconUrl": "sphinxchat.png",
|
||||
"platforms": ["iOS", "Android", "macOS", "Windows", "Linux"],
|
||||
"supportedElements": [
|
||||
{
|
||||
"elementName": "Value",
|
||||
"elementURL": "https://twitter.com/MartyBent/status/1325892586985451520"
|
||||
},
|
||||
{
|
||||
"elementName": "Search",
|
||||
"elementURL": "https://twitter.com/MartyBent/status/1325892586985451520"
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
"appName": "AntennaPod",
|
||||
"appType": "app",
|
||||
"appUrl": "https://www.antennapod.org",
|
||||
"appIconUrl": "antennapod.png",
|
||||
"platforms": ["Android"],
|
||||
"supportedElements": [
|
||||
{
|
||||
"elementName": "Search",
|
||||
"elementURL": "https://github.com/AntennaPod/AntennaPod/pull/4435"
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
"appName": "CastCoverage",
|
||||
"appType": "app",
|
||||
"appUrl": "http://castcoverage.com",
|
||||
"appIconUrl": "castcoverage.png",
|
||||
"platforms": ["Web"],
|
||||
"supportedElements": [
|
||||
{
|
||||
"elementName": "Search",
|
||||
"elementURL": "http://castcoverage.com"
|
||||
}
|
||||
]
|
||||
}
|
||||
]
|
||||
@@ -0,0 +1,7 @@
|
||||
{
|
||||
"feedCountTotal": "1,328,328",
|
||||
"feedCount3days": "81,919",
|
||||
"feedCount10days": "208,264",
|
||||
"feedCount30days": "303,007",
|
||||
"feedCount60days": "376,576"
|
||||
}
|
||||
@@ -0,0 +1,82 @@
|
||||
const path = require('path')
|
||||
const fs = require('fs');
|
||||
const express = require('express')
|
||||
const app = express() // create express app
|
||||
// Gets the .env variables
|
||||
require('dotenv').config()
|
||||
|
||||
// Utilizing the node repo from comster/podcast-index-api :)
|
||||
// NOTE: This server will work as a reverse proxy.
|
||||
const api = require('podcast-index-api')(
|
||||
process.env.API_KEY,
|
||||
process.env.API_SECRET
|
||||
)
|
||||
|
||||
// ------------------------------------------------
|
||||
// ------------ Reverse proxy for API -------------
|
||||
// ------------------------------------------------
|
||||
|
||||
app.use('/api/search/byterm', async (req, res) => {
|
||||
let term = req.query.q
|
||||
const response = await api.searchByTerm(term)
|
||||
res.send(response)
|
||||
})
|
||||
|
||||
app.use('/api/recent/episodes', async (req, res) => {
|
||||
let max = req.query.max
|
||||
const response = await api.recentEpisodes(max)
|
||||
res.send(response)
|
||||
})
|
||||
|
||||
app.use('/api/podcasts/byfeedid', async (req, res) => {
|
||||
let feedId = req.query.id
|
||||
const response = await api.podcastsByFeedId(feedId)
|
||||
res.send(response)
|
||||
})
|
||||
|
||||
app.use('/api/episodes/byfeedid', async (req, res) => {
|
||||
let feedId = req.query.id
|
||||
const response = await api.episodesByFeedId(feedId)
|
||||
res.send(response)
|
||||
})
|
||||
|
||||
// ------------------------------------------------
|
||||
// ---------- Static files for API data -----------
|
||||
// ------------------------------------------------
|
||||
|
||||
app.use('/api/stats', async (req, res) => {
|
||||
fs.readFile('./server/data/stats.json', 'utf8', (err, data) => {
|
||||
// You should always specify the content type header,
|
||||
// when you don't use 'res.json' for sending JSON.
|
||||
res.set('Content-Type', 'application/json');
|
||||
res.send(data)
|
||||
})
|
||||
})
|
||||
|
||||
app.use('/api/apps', async (req, res) => {
|
||||
fs.readFile('./server/data/apps.json', 'utf8', (err, data) => {
|
||||
// You should always specify the content type header,
|
||||
// when you don't use 'res.json' for sending JSON.
|
||||
res.set('Content-Type', 'application/json');
|
||||
res.send(data)
|
||||
})
|
||||
})
|
||||
|
||||
app.use('/api/images', express.static('./server/assets'))
|
||||
|
||||
// ------------------------------------------------
|
||||
// ---------- Static content for client -----------
|
||||
// ------------------------------------------------
|
||||
|
||||
app.use(express.static('./server/www'))
|
||||
app.get('*', (req, res) => res.sendFile(path.resolve('server', 'www', 'index.html')))
|
||||
|
||||
// ------------------------------------------------
|
||||
|
||||
|
||||
const PORT = process.env.PORT || 333;
|
||||
|
||||
// start express server on port 5001 (default)
|
||||
app.listen(PORT, () => {
|
||||
console.log(`server started on port ${PORT}`)
|
||||
})
|
||||
@@ -1,39 +0,0 @@
|
||||
import * as React from 'react'
|
||||
import { Link } from 'react-router-dom'
|
||||
|
||||
import './styles.scss'
|
||||
|
||||
interface IProps {
|
||||
link?: boolean
|
||||
children?: any
|
||||
style?: string
|
||||
href?: string
|
||||
onClick?: () => void
|
||||
}
|
||||
|
||||
export default class Button extends React.PureComponent<IProps> {
|
||||
static defaultProps = {}
|
||||
|
||||
render() {
|
||||
const { children, href, onClick, link } = this.props
|
||||
return (
|
||||
<div className="button-wrapper">
|
||||
{href && !link && (
|
||||
<a href={href} className="button">
|
||||
{children}
|
||||
</a>
|
||||
)}
|
||||
{href && link && (
|
||||
<Link className="button" to={href}>
|
||||
{children}
|
||||
</Link>
|
||||
)}
|
||||
{!href && (
|
||||
<div className="button" onClick={onClick}>
|
||||
{children}
|
||||
</div>
|
||||
)}
|
||||
</div>
|
||||
)
|
||||
}
|
||||
}
|
||||
@@ -1,101 +0,0 @@
|
||||
import * as React from 'react'
|
||||
|
||||
import KPI from '../../../components/KPI'
|
||||
import Card from '../../../components/Card'
|
||||
|
||||
import './styles.scss'
|
||||
|
||||
interface IProps {
|
||||
total: number
|
||||
threedays: number
|
||||
tendays: number
|
||||
lastWeek: number
|
||||
lastMonth: number
|
||||
last60: number
|
||||
last90: number
|
||||
}
|
||||
|
||||
export default class StatsCard extends React.Component<IProps> {
|
||||
static defaultProps = {
|
||||
total: 1317362,
|
||||
threedays: 73852,
|
||||
tendays: 210830,
|
||||
lastWeek: 133434,
|
||||
lastMonth: 310658,
|
||||
last60: 403350,
|
||||
last90: 499568,
|
||||
}
|
||||
|
||||
constructor(props: IProps) {
|
||||
super(props)
|
||||
}
|
||||
|
||||
numberWithCommas(number: number) {
|
||||
return number.toString().replace(/\B(?=(\d{3})+(?!\d))/g, ',')
|
||||
}
|
||||
|
||||
render() {
|
||||
const {
|
||||
total,
|
||||
threedays,
|
||||
tendays,
|
||||
lastWeek,
|
||||
lastMonth,
|
||||
last60,
|
||||
last90,
|
||||
} = this.props
|
||||
return (
|
||||
<div className="kpi-card">
|
||||
<Card>
|
||||
<div className="kpi-massive-title">
|
||||
Total podcasts in the index ...
|
||||
</div>
|
||||
<div className="kpi-massive-value">
|
||||
{this.numberWithCommas(total)}
|
||||
</div>
|
||||
<div className="kpi-massive-title kpi-title-2">
|
||||
Show published in the last ...
|
||||
</div>
|
||||
<div className="kpi-row">
|
||||
<KPI
|
||||
title="3 days"
|
||||
value={this.numberWithCommas(threedays)}
|
||||
/>
|
||||
<KPI
|
||||
title="10 days"
|
||||
value={this.numberWithCommas(tendays)}
|
||||
/>
|
||||
<KPI
|
||||
title="30 days"
|
||||
value={this.numberWithCommas(lastMonth)}
|
||||
/>
|
||||
<KPI
|
||||
title="60 days"
|
||||
value={this.numberWithCommas(last60)}
|
||||
/>
|
||||
<KPI
|
||||
title="90 days"
|
||||
value={this.numberWithCommas(last90)}
|
||||
/>
|
||||
|
||||
{/* <KPI
|
||||
big
|
||||
title="Last Week"
|
||||
value={this.numberWithCommas(lastWeek)}
|
||||
/>
|
||||
<KPI
|
||||
big
|
||||
title="Last Month"
|
||||
value={this.numberWithCommas(lastMonth)}
|
||||
/>
|
||||
<KPI
|
||||
big
|
||||
title="Last 90 days"
|
||||
value={this.numberWithCommas(last90)}
|
||||
/> */}
|
||||
</div>
|
||||
</Card>
|
||||
</div>
|
||||
)
|
||||
}
|
||||
}
|
||||
@@ -1,182 +0,0 @@
|
||||
import * as React from 'react'
|
||||
|
||||
// Components
|
||||
import PodcastPlayer from '../components/PodcastPlayer'
|
||||
import StatsCard from './Stats/StatsCard'
|
||||
// APIs
|
||||
// import API from '../api'
|
||||
|
||||
import './styles.scss'
|
||||
|
||||
interface IProps {}
|
||||
interface IState {
|
||||
loading?: boolean
|
||||
recentPodcasts?: Array<any>
|
||||
}
|
||||
|
||||
export default class Landing extends React.Component<IProps, IState> {
|
||||
state = {
|
||||
loading: true,
|
||||
recentPodcasts: [],
|
||||
}
|
||||
_isMounted = false
|
||||
|
||||
constructor(props: IProps) {
|
||||
super(props)
|
||||
}
|
||||
|
||||
async componentDidMount(): Promise<void> {
|
||||
this._isMounted = true
|
||||
const recentPodcasts = (await this.getRecentEpisodes()).items
|
||||
if (this._isMounted) {
|
||||
this.setState({
|
||||
loading: false,
|
||||
recentPodcasts,
|
||||
})
|
||||
}
|
||||
}
|
||||
|
||||
componentWillUnmount() {
|
||||
this._isMounted = false
|
||||
}
|
||||
|
||||
async getRecentEpisodes() {
|
||||
let response = await fetch(`/api/recent/episodes?max=7`, {
|
||||
credentials: 'same-origin',
|
||||
method: 'GET',
|
||||
})
|
||||
return await response.json()
|
||||
}
|
||||
|
||||
render() {
|
||||
const { loading, recentPodcasts } = this.state
|
||||
return (
|
||||
<div className="landing-content">
|
||||
<div className="hero-pitch">
|
||||
<div className="hero-pitch-left">
|
||||
<h1 className="hero-pitch-text">
|
||||
Let’s preserve podcasting as a platform for free
|
||||
speech
|
||||
</h1>
|
||||
|
||||
<div className="hero-pitch-subtitle">
|
||||
We do this by enabling developers to have access to
|
||||
an open, categorized index that will always be
|
||||
available for free, for any use.
|
||||
</div>
|
||||
<h5>
|
||||
Listen to the first episode of "Podcasting 2.0",
|
||||
where we discuss the project, and it's goals.
|
||||
</h5>
|
||||
<div className="listen-row">
|
||||
<audio controls preload="none">
|
||||
<source
|
||||
src="https://mp3s.nashownotes.com/PC20-01-2020-08-28-Final.mp3"
|
||||
type="audio/mpeg"
|
||||
/>
|
||||
</audio>
|
||||
<a
|
||||
className="subscribe-badge"
|
||||
title="Subscribe"
|
||||
target="_blank"
|
||||
href="http://mp3s.nashownotes.com/pc20rss.xml"
|
||||
>
|
||||
<svg
|
||||
width="2em"
|
||||
height="2em"
|
||||
viewBox="0 0 16 16"
|
||||
className="bi bi-rss-fill"
|
||||
fill="currentColor"
|
||||
xmlns="http://www.w3.org/2000/svg"
|
||||
>
|
||||
<path
|
||||
fillRule="evenodd"
|
||||
d="M2 0a2 2 0 0 0-2 2v12a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V2a2 2 0 0 0-2-2H2zm1.5 2.5a1 1 0 0 0 0 2 8 8 0 0 1 8 8 1 1 0 1 0 2 0c0-5.523-4.477-10-10-10zm0 4a1 1 0 0 0 0 2 4 4 0 0 1 4 4 1 1 0 1 0 2 0 6 6 0 0 0-6-6zm.5 7a1.5 1.5 0 1 0 0-3 1.5 1.5 0 0 0 0 3z"
|
||||
></path>
|
||||
</svg>
|
||||
</a>
|
||||
</div>
|
||||
</div>
|
||||
<div className="hero-pitch-right">
|
||||
<PodcastPlayer
|
||||
title="Recent Podcasts"
|
||||
loading={loading}
|
||||
podcasts={recentPodcasts}
|
||||
/>
|
||||
</div>
|
||||
</div>
|
||||
<StatsCard />
|
||||
<div className="info-section">
|
||||
<h3>Promise</h3>
|
||||
<p>
|
||||
The core, categorized index will always be available for
|
||||
free, for any use.
|
||||
</p>
|
||||
<h3>Operations</h3>
|
||||
<p>
|
||||
Podcast Index LLC is a software developer focused
|
||||
partnership that provides tools and data to anyone who
|
||||
aspires to create new and exciting Podcast experiences
|
||||
without the heavy lifting of indexing, aggregation and
|
||||
data management.
|
||||
</p>
|
||||
<h3>Financing</h3>
|
||||
<p>
|
||||
The core Podcast Index is financed by its founders and
|
||||
stakeholders: Podcasters, Developers and Listeners.
|
||||
</p>
|
||||
<p>
|
||||
Corporate interests and advertising are antithetical to
|
||||
our business.
|
||||
</p>
|
||||
<p>
|
||||
Podcast Index LLC strives to grow by providing enhanced
|
||||
API services of value to developers and organizations.
|
||||
</p>
|
||||
<h3>Mission and Goal</h3>
|
||||
<p>Preserve podcasting as a platform for free speech.</p>
|
||||
<p>
|
||||
Re-tool podcasting to a platform of value exchange that
|
||||
includes developers with podcasters and listeners.
|
||||
</p>
|
||||
</div>
|
||||
<div id="donate" className="info-section">
|
||||
<h3>Help us out...</h3>
|
||||
<p>
|
||||
None of this is free. If you get any value from this
|
||||
project, or if you just believe in it and want to help
|
||||
us out with hosting fees and paying the bills, a
|
||||
donation of any amount would be great.
|
||||
</p>
|
||||
<form
|
||||
action="https://www.paypal.com/cgi-bin/webscr"
|
||||
method="post"
|
||||
target="_top"
|
||||
>
|
||||
<input type="hidden" name="cmd" value="_s-xclick" />
|
||||
<input
|
||||
type="hidden"
|
||||
name="hosted_button_id"
|
||||
value="9GEMYSYB7G2DW"
|
||||
/>
|
||||
<input
|
||||
type="image"
|
||||
src="https://www.paypalobjects.com/en_US/i/btn/btn_donate_LG.gif"
|
||||
// border="0"
|
||||
name="submit"
|
||||
title="PayPal - The safer, easier way to pay online!"
|
||||
alt="Donate with PayPal button"
|
||||
/>
|
||||
<img
|
||||
alt=""
|
||||
// border="0"
|
||||
src="https://www.paypal.com/en_US/i/scr/pixel.gif"
|
||||
width="1"
|
||||
height="1"
|
||||
/>
|
||||
</form>
|
||||
</div>
|
||||
</div>
|
||||
)
|
||||
}
|
||||
}
|
||||
@@ -1,194 +0,0 @@
|
||||
.landing-content {
|
||||
position: relative;
|
||||
z-index: 1;
|
||||
padding: 0 0 20px 0;
|
||||
margin: 0 auto;
|
||||
}
|
||||
|
||||
.hero-pitch {
|
||||
display: flex;
|
||||
font-family: var(--font-family-exp);
|
||||
width: inherit;
|
||||
margin: auto;
|
||||
margin-top: 20px;
|
||||
margin-bottom: 80px;
|
||||
}
|
||||
|
||||
.hero-pitch-left {
|
||||
display: inline-flex;
|
||||
flex: 1;
|
||||
flex-direction: column;
|
||||
justify-content: center;
|
||||
audio {
|
||||
outline: none;
|
||||
}
|
||||
h5 {
|
||||
max-width: 400px;
|
||||
}
|
||||
.listen-row {
|
||||
display: flex;
|
||||
flex-direction: row;
|
||||
align-items: center;
|
||||
}
|
||||
svg {
|
||||
fill: #868686;
|
||||
}
|
||||
.subscribe-badge {
|
||||
margin-left: 10px;
|
||||
}
|
||||
}
|
||||
|
||||
.hero-pitch-text {
|
||||
// font-family: var(--font-family-exp);
|
||||
font-size: 55px;
|
||||
color: #2d2d2d;
|
||||
}
|
||||
|
||||
.hero-pitch-subtitle {
|
||||
font-size: 22px;
|
||||
max-width: 425px;
|
||||
color: #868686;
|
||||
margin-bottom: 10px;
|
||||
}
|
||||
|
||||
.hero-pitch-right {
|
||||
display: inline-flex;
|
||||
flex: 1;
|
||||
flex-direction: column;
|
||||
justify-content: center;
|
||||
align-items: center;
|
||||
width: inherit;
|
||||
// height: 640px;
|
||||
}
|
||||
|
||||
.info-section {
|
||||
margin-top: 50px;
|
||||
p {
|
||||
font-family: var(--font-family-exp);
|
||||
font-size: 18px;
|
||||
line-height: 20px;
|
||||
color: #868686;
|
||||
}
|
||||
}
|
||||
|
||||
#donate {
|
||||
margin-bottom: 20px;
|
||||
}
|
||||
|
||||
.results-list {
|
||||
margin: 0 auto;
|
||||
position: relative;
|
||||
z-index: 1;
|
||||
width: 1024px;
|
||||
}
|
||||
.loader-wrapper {
|
||||
margin: 0 auto;
|
||||
position: relative;
|
||||
height: 100%;
|
||||
z-index: 1;
|
||||
display: flex;
|
||||
flex-direction: row;
|
||||
justify-content: center;
|
||||
align-items: center;
|
||||
}
|
||||
|
||||
@media only screen and (min-width: 1168px) {
|
||||
/* tablets and desktop */
|
||||
.landing-content {
|
||||
width: 1108px;
|
||||
}
|
||||
.hero-pitch {
|
||||
flex-direction: row;
|
||||
}
|
||||
}
|
||||
|
||||
/* TABLETS PORTRAIT */
|
||||
@media only screen and (max-width: 1167px) {
|
||||
/* tablets and desktop */
|
||||
.landing-content {
|
||||
min-width: 768px;
|
||||
width: calc(100% - 40px);
|
||||
}
|
||||
// .hero-pitch {
|
||||
// align-items: center;
|
||||
// flex-direction: column;
|
||||
// flex-flow: column;
|
||||
// text-align: center;
|
||||
// }
|
||||
.hero-pitch-text {
|
||||
font-size: 42px;
|
||||
}
|
||||
.hero-pitch-subtitle {
|
||||
margin-top: 0 !important;
|
||||
max-width: 100% !important;
|
||||
font-size: 20px;
|
||||
}
|
||||
.info-section {
|
||||
padding: 0 20px;
|
||||
}
|
||||
.hero-pitch-right {
|
||||
margin-top: 40px;
|
||||
// padding: 0 10px;
|
||||
}
|
||||
}
|
||||
|
||||
@media only screen and (max-width: 1010px) {
|
||||
.results-list {
|
||||
width: 100% !important;
|
||||
}
|
||||
}
|
||||
|
||||
@media only screen and (max-width: 980px) {
|
||||
.hero-pitch {
|
||||
align-items: center;
|
||||
flex-direction: column;
|
||||
flex-flow: column;
|
||||
text-align: center;
|
||||
max-width: 600px;
|
||||
}
|
||||
.hero-pitch-text {
|
||||
padding: 0 30px;
|
||||
}
|
||||
.hero-pitch-subtitle {
|
||||
padding: 0 30px;
|
||||
}
|
||||
.results-list {
|
||||
width: 100% !important;
|
||||
}
|
||||
.hero-pitch-left {
|
||||
padding: 0 20px;
|
||||
align-items: center;
|
||||
h5 {
|
||||
text-align: center;
|
||||
}
|
||||
.listen-row {
|
||||
justify-content: center;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@media only screen and (max-width: 767px) {
|
||||
.hero-pitch {
|
||||
margin-bottom: 40px;
|
||||
}
|
||||
/* phones */
|
||||
.landing-content {
|
||||
min-width: 350px;
|
||||
max-width: 600px;
|
||||
width: 100%;
|
||||
}
|
||||
}
|
||||
|
||||
// @media only screen and (max-width: 767px) and (orientation: portrait) {
|
||||
// /* portrait phones */
|
||||
// .landing-content {
|
||||
// min-width: 350px;
|
||||
// width: 100%;
|
||||
// }
|
||||
// .hero-pitch-left {
|
||||
// padding: 0 20px;
|
||||
// }
|
||||
// // .hero-pitch-right {
|
||||
// // padding: 0 20px;
|
||||
// // }
|
||||
// }
|
||||
@@ -1,66 +0,0 @@
|
||||
import * as React from 'react'
|
||||
import { Route, Switch } from 'react-router-dom'
|
||||
import { history } from './state/store'
|
||||
|
||||
import Landing from './pages/landing'
|
||||
import Results from './pages/results'
|
||||
import Stats from './pages/Stats'
|
||||
|
||||
type RouteType = {
|
||||
path: string
|
||||
name: string
|
||||
exact?: boolean
|
||||
icon?: string
|
||||
topbar?: Function
|
||||
component?: any
|
||||
routes: Array<any>
|
||||
}
|
||||
export const routes: Array<RouteType> = [
|
||||
// {
|
||||
// path: '/',
|
||||
// exact: false,
|
||||
// name: 'Home',
|
||||
// component: Main,
|
||||
// routes: [
|
||||
// {
|
||||
// path: '/',
|
||||
// exact: true,
|
||||
// name: 'Home',
|
||||
// component: Landing,
|
||||
// },
|
||||
// {
|
||||
// path: '/search',
|
||||
// exact: true,
|
||||
// name: 'Search',
|
||||
// component: Results,
|
||||
// },
|
||||
// ],
|
||||
// },
|
||||
]
|
||||
|
||||
export function RouteWithSubRoutes(route: RouteType) {
|
||||
return (
|
||||
<Route
|
||||
path={route.path}
|
||||
render={(props) => (
|
||||
<route.component {...props} routes={route.routes} />
|
||||
)}
|
||||
/>
|
||||
)
|
||||
}
|
||||
|
||||
const Routes: React.SFC = () => (
|
||||
<Switch>
|
||||
<Route exact path="/" render={() => <Landing />} />
|
||||
<Route
|
||||
path="/search"
|
||||
render={(props) => <Results {...props} history={history} />}
|
||||
component={Results}
|
||||
/>
|
||||
<Route exact path="/stats" render={() => <Stats />} />
|
||||
|
||||
<Route component={() => <div>Not Found</div>} />
|
||||
</Switch>
|
||||
)
|
||||
|
||||
export default Routes
|
||||
@@ -1,7 +0,0 @@
|
||||
export const cleanSearchQuery = (queryString: string) => {
|
||||
if (!queryString) {
|
||||
return ''
|
||||
}
|
||||
let queryAr = queryString.split('=')
|
||||
return decodeURIComponent(queryAr[1])
|
||||
}
|
||||
@@ -8,7 +8,8 @@
|
||||
"moduleResolution": "node",
|
||||
"allowJs": true,
|
||||
"skipLibCheck": true,
|
||||
"allowSyntheticDefaultImports": true
|
||||
"allowSyntheticDefaultImports": true,
|
||||
"resolveJsonModule": true
|
||||
},
|
||||
"exclude": ["node_modules"]
|
||||
}
|
||||
|
After Width: | Height: | Size: 16 KiB |
@@ -0,0 +1,12 @@
|
||||
|
||||
<svg width="41px" height="42px" viewBox="0 0 41 42" version="1.1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink">
|
||||
<g stroke="none" stroke-width="1" fill="none" fill-rule="evenodd">
|
||||
<g transform="translate(-23.000000, -16.000000)" fill="#F90000">
|
||||
<g transform="translate(23.000000, 16.000000)">
|
||||
<path d="M19.7935646,16 L21.1438236,16 C21.9722507,16 22.6438236,16.6715729 22.6438236,17.5 C22.6438236,17.6058285 22.632624,17.7113599 22.6104119,17.8148311 L17.4186047,42 L13,42 L18.3269763,17.1851689 C18.4753878,16.4938186 19.0864641,16 19.7935646,16 Z" id="Rectangle"></path>
|
||||
<path d="M11.1084922,22.2287199 C6.355958,17.7559478 6.7537472,10.8190095 11.1294284,6.78109016 C11.9668794,6.01492086 13.3068009,6.05633542 14.0605068,6.90533384 C14.8560852,7.73362498 14.7932763,9.03818352 13.9558254,9.8250601 C11.2969186,12.2892262 11.0456833,16.4720965 13.9767617,19.2261645 C14.8142126,20.0130411 14.8560852,21.3175997 14.0605068,22.1458908 C13.2649284,22.974182 11.9459431,23.0155965 11.1084922,22.2287199 Z M9.64194995,25.2726899 C10.6887636,25.8939082 10.8981264,27.1363449 10.0606754,28.1717089 C9.64194995,28.7929272 9.01386174,29 8.38577352,29 C7.96704805,29 7.54832257,28.7929272 7.1295971,28.5858544 C2.94234234,25.4797627 0.220626747,20.0958702 0.0112640095,14.504905 C-0.198098728,8.70686707 2.52361686,3.94419301 7.1295971,0.423955663 C7.96704805,-0.197262692 9.43258721,-0.197262692 10.0606754,0.838101233 C10.6887636,1.66639237 10.6887636,3.11590187 9.64194995,3.73712022 C6.08278341,6.42906643 4.19851877,10.1563766 4.19851877,14.504905 C4.19851877,18.6463607 6.29214615,22.9948892 9.64194995,25.2726899 Z M26.9329847,22.1458908 C26.1374063,21.3175997 26.1792789,20.0130411 26.9957935,19.2054573 C29.9268719,16.4513892 29.6965729,12.268519 27.0167298,9.80435283 C26.1792789,9.03818352 26.11647,7.7129177 26.9120485,6.88462656 C27.6866906,6.05633542 29.0266121,5.99421358 29.8640631,6.78109016 C34.2397443,10.8190095 34.6375335,17.7559478 29.8849993,22.2287199 C29.0475484,23.0155965 27.7285631,22.974182 26.9329847,22.1458908 Z M33.872416,0.423955663 C38.4783962,3.94419301 41.1791755,8.70686707 40.9907491,14.504905 C40.9907491,20.0958702 38.2690335,25.4797627 33.872416,28.5858544 C33.4536905,28.7929272 33.034965,29 32.6162396,29 C31.9881514,29 31.3600631,28.7929272 30.9413377,28.1717089 C30.1038867,27.1363449 30.3132495,25.8939082 31.3600631,25.2726899 C34.7098669,22.9948892 36.8034943,18.6463607 36.8034943,14.504905 C36.8034943,10.1563766 34.9192297,6.42906643 31.3600631,3.73712022 C30.3132495,3.11590187 30.3132495,1.66639237 30.9413377,0.838101233 C31.5694259,-0.197262692 33.034965,-0.197262692 33.872416,0.423955663 Z" id="Shape"></path>
|
||||
<circle id="Oval" cx="20.5" cy="14.5" r="4.5"></circle>
|
||||
</g>
|
||||
</g>
|
||||
</g>
|
||||
</svg>
|
||||
|
After Width: | Height: | Size: 2.8 KiB |
@@ -0,0 +1,7 @@
|
||||
<svg width="201px" height="26px" viewBox="0 0 201 26" version="1.1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink">
|
||||
<g stroke="none" stroke-width="1" fill="none" fill-rule="evenodd">
|
||||
<g transform="translate(-78.000000, -25.000000)" fill="#E90000" fill-rule="nonzero" stroke="#FF0000" stroke-width="2">
|
||||
<path d="M97.1995,27.7645 C98.2445007,28.6775007 98.767,29.9699993 98.767,31.642 C98.767,33.2479997 98.3984993,34.6615 97.6615,35.8825 C96.9244987,37.1035 95.8849987,38.0550003 94.543,38.737 C93.2010003,39.4189997 91.672,39.76 89.956,39.76 L84.247,39.76 L82.267,49 L79.858,49 L84.676,26.395 L92.827,26.395 C94.6969997,26.395 96.1544993,26.8514993 97.1995,27.7645 Z M94.6585,36.163 C95.7694997,35.1949866 96.325,33.7979862 96.325,31.972 C96.325,29.7059993 94.9500003,28.573 92.2,28.573 L86.623,28.573 L84.709,37.615 L90.187,37.615 C92.0569997,37.615 93.5475003,37.1310003 94.6585,36.163 Z M101.945,48.051 C100.991667,47.2796669 100.515,46.0793335 100.515,44.45 C100.515,43.826 100.593,43.124 100.749,42.344 L101.737,37.69 C102.707667,33.114 105.169,30.826 109.121,30.826 C110.715667,30.826 111.989667,31.2116661 112.943,31.983 C113.896334,32.7543339 114.373,33.9546661 114.373,35.584 C114.373,36.208 114.295,36.91 114.139,37.69 L113.151,42.344 C112.180333,46.92 109.736334,49.208 105.819,49.208 C104.189667,49.208 102.898333,48.8223335 101.945,48.051 Z M109.381,46.27 C110.230333,45.4726657 110.845667,44.1986657 111.227,42.448 L112.241,37.768 C112.379666,37.144 112.449,36.5286669 112.449,35.922 C112.449,33.6686661 111.261667,32.542 108.887,32.542 C107.483,32.542 106.356333,32.9493339 105.507,33.764 C104.657667,34.5786661 104.033667,35.9133331 103.635,37.768 L102.621,42.448 C102.482333,43.1066665 102.413,43.6786665 102.413,44.164 C102.413,46.3653335 103.635,47.466 106.079,47.466 C107.431,47.466 108.531667,47.0673331 109.381,46.27 Z M120.239,31.06 L126.323,31.06 C127.883012,31.06 129.113679,31.4283339 130.015,32.165 C130.916334,32.9016963 131.367,34.0673624 131.367,35.662 C131.367,36.3553569 131.280334,37.1006899 131.107,37.898 L130.197,42.162 C129.694332,44.5366669 128.766999,46.27 127.415,47.362 C126.063,48.454 124.442333,49 122.553,49 L116.417,49 L120.239,31.06 Z M122.917,47.284 C125.777,47.284 127.562333,45.6113335 128.273,42.266 L129.183,37.976 C129.356334,37.1093101 129.443,36.4246431 129.443,35.922 C129.443,34.83 129.157,34.0326661 128.585,33.53 C128.013,33.0273339 127.181,32.776 126.089,32.776 L121.773,32.776 L118.705,47.284 L122.917,47.284 Z M135.712,48.051 C134.75,47.2796669 134.269,46.0793335 134.269,44.45 C134.269,43.826 134.347,43.124 134.503,42.344 L135.491,37.69 C135.993667,35.2806534 136.899333,33.5343196 138.208,32.451 C139.51667,31.3676661 141.124337,30.826 143.031,30.826 C144.712333,30.826 146.003667,31.242 146.905,32.074 C147.806334,32.906 148.257,34.0586661 148.257,35.532 C148.257,35.8093331 148.231,36.0953331 148.179,36.39 L146.281,36.39 C146.315666,36.234 146.333,36.0173331 146.333,35.74 C146.333,34.7173339 146.034,33.9286661 145.436,33.374 C144.838,32.8193339 143.958333,32.542 142.797,32.542 C141.375667,32.542 140.218667,32.9493339 139.326,33.764 C138.433331,34.5786661 137.787664,35.9133331 137.389,37.768 L136.375,42.448 C136.236333,43.1066721 136.167,43.6613386 136.167,44.112 C136.167,45.256 136.496333,46.101 137.155,46.647 C137.813667,47.193 138.732333,47.466 139.911,47.466 C141.193675,47.4659992 142.242342,47.1366661 143.057,46.478 C143.871688,45.8193331 144.426355,44.9006665 144.721,43.722 L144.747,43.618 L146.593,43.618 L146.567,43.722 C146.133666,45.4206669 145.314667,46.7596665 144.11,47.739 C142.905333,48.7183335 141.393,49.208 139.573,49.208 C137.961,49.208 136.674,48.8223335 135.712,48.051 Z M159.869,44.684 L152.251,44.684 L149.833,49 L147.831,49 L158.153,31.06 L159.765,31.06 L162.443,49 L160.467,49 L159.869,44.684 Z M159.661,43.072 L158.387,33.712 L153.161,43.072 L159.661,43.072 Z M166.723,48.038 C165.804333,47.2926669 165.345,46.218 165.345,44.814 C165.345,44.4326665 165.362333,44.138 165.397,43.93 L167.243,43.93 C167.225667,44.0686665 167.217,44.268 167.217,44.528 C167.217001,46.504 168.404334,47.492 170.779,47.492 C172.373667,47.492 173.595667,47.128 174.445,46.4 C175.294333,45.672 175.719,44.6753335 175.719,43.41 C175.719,42.682 175.498,42.1143331 175.056,41.707 C174.614,41.2996669 173.933667,41.0093331 173.015,40.836 L170.987,40.446 C168.543,39.978 167.321,38.7386669 167.321,36.728 C167.321,35.5146661 167.602667,34.466 168.166,33.582 C168.729333,32.698 169.522333,32.0176661 170.545,31.541 C171.567667,31.0643339 172.737667,30.826 174.055,30.826 C175.545667,30.826 176.741667,31.1856661 177.643,31.905 C178.544334,32.6243339 178.995,33.7033339 178.995,35.142 C178.995,35.4366661 178.986334,35.662 178.969,35.818 L177.097,35.818 C177.131667,35.506 177.149,35.2893339 177.149,35.168 C177.149,33.3653339 176.074333,32.464 173.925,32.464 C172.469,32.464 171.320667,32.828 170.48,33.556 C169.639333,34.284 169.219,35.22 169.219,36.364 C169.219,37.04 169.431333,37.5773331 169.856,37.976 C170.280667,38.3746669 170.926333,38.652 171.793,38.808 L173.873,39.198 C175.103667,39.4233513 176.039667,39.8436844 176.681,40.459 C177.322333,41.0743331 177.643,41.928 177.643,43.02 C177.643,44.9613343 177.019,46.4693343 175.771,47.544 C174.523,48.6186669 172.807,49.156 170.623,49.156 C168.941666,49.156 16Line truncated
|
||||
</g>
|
||||
</g>
|
||||
</svg>
|
||||
|
After Width: | Height: | Size: 6.7 KiB |
|
Before Width: | Height: | Size: 537 B After Width: | Height: | Size: 537 B |
|
Before Width: | Height: | Size: 533 B After Width: | Height: | Size: 533 B |
@@ -0,0 +1,7 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?><!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN"
|
||||
"http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd">
|
||||
<svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" version="1.1" width="24" height="24"
|
||||
viewBox="0 0 24 24" fill="#868686">
|
||||
<path
|
||||
d="M17.9,17.39C17.64,16.59 16.89,16 16,16H15V13A1,1 0 0,0 14,12H8V10H10A1,1 0 0,0 11,9V7H13A2,2 0 0,0 15,5V4.59C17.93,5.77 20,8.64 20,12C20,14.08 19.2,15.97 17.9,17.39M11,19.93C7.05,19.44 4,16.08 4,12C4,11.38 4.08,10.78 4.21,10.21L9,15V16A2,2 0 0,0 11,18M12,2A10,10 0 0,0 2,12A10,10 0 0,0 12,22A10,10 0 0,0 22,12A10,10 0 0,0 12,2Z"/>
|
||||
</svg>
|
||||
|
After Width: | Height: | Size: 661 B |
@@ -0,0 +1,9 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<!DOCTYPE svg
|
||||
PUBLIC '-//W3C//DTD SVG 1.1//EN'
|
||||
'http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd'>
|
||||
<svg fill="#868686" height="24" version="1.1" viewBox="0 0 24 24" width="24" xmlns="http://www.w3.org/2000/svg"
|
||||
xmlns:xlink="http://www.w3.org/1999/xlink">
|
||||
<path
|
||||
d="M5,3H19A2,2 0 0,1 21,5V19A2,2 0 0,1 19,21H5A2,2 0 0,1 3,19V5A2,2 0 0,1 5,3M7.5,15A1.5,1.5 0 0,0 6,16.5A1.5,1.5 0 0,0 7.5,18A1.5,1.5 0 0,0 9,16.5A1.5,1.5 0 0,0 7.5,15M6,10V12A6,6 0 0,1 12,18H14A8,8 0 0,0 6,10M6,6V8A10,10 0 0,1 16,18H18A12,12 0 0,0 6,6Z"/>
|
||||
</svg>
|
||||
|
After Width: | Height: | Size: 590 B |
|
Before Width: | Height: | Size: 691 B After Width: | Height: | Size: 691 B |
|
Before Width: | Height: | Size: 1.3 KiB After Width: | Height: | Size: 1.3 KiB |
|
Before Width: | Height: | Size: 6.8 KiB After Width: | Height: | Size: 6.8 KiB |
@@ -0,0 +1,6 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?><!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN"
|
||||
"http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd">
|
||||
<svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" version="1.1" width="24" height="24"
|
||||
viewBox="0 0 24 24" fill="#e90000">
|
||||
<path d="M15,16H13V8H15M11,16H9V8H11M12,2A10,10 0 0,0 2,12A10,10 0 0,0 12,22A10,10 0 0,0 22,12A10,10 0 0,0 12,2Z"/>
|
||||
</svg>
|
||||
|
After Width: | Height: | Size: 429 B |
|
Before Width: | Height: | Size: 58 KiB After Width: | Height: | Size: 58 KiB |
|
Before Width: | Height: | Size: 82 KiB After Width: | Height: | Size: 82 KiB |
@@ -0,0 +1,6 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?><!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN"
|
||||
"http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd">
|
||||
<svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" version="1.1" width="24" height="24"
|
||||
viewBox="0 0 24 24" fill="#e90000">
|
||||
<path d="M10,16.5V7.5L16,12M12,2A10,10 0 0,0 2,12A10,10 0 0,0 12,22A10,10 0 0,0 22,12A10,10 0 0,0 12,2Z"/>
|
||||
</svg>
|
||||
|
After Width: | Height: | Size: 420 B |
|
Before Width: | Height: | Size: 1.1 KiB After Width: | Height: | Size: 1.1 KiB |
@@ -3,9 +3,6 @@
|
||||
<head>
|
||||
<meta charset="utf-8" />
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1" />
|
||||
<link rel="shortcut icon" href="favicon.ico" />
|
||||
<link rel="alternate icon" href="/favicon.ico" />
|
||||
<link rel="mask-icon" href="/safari-pinned-tab.svg" color="#ff8a01" />
|
||||
<!-- Style dependencies -->
|
||||
<!-- <link href="https://unpkg.com/normalize.css@^7.0.0" rel="stylesheet" /> -->
|
||||
<title>Podcastindex.org</title>
|
||||
@@ -0,0 +1,5 @@
|
||||
<svg width="261.12" height="246.72" version="1.1" viewBox="0 0 69.088 65.278" xmlns="http://www.w3.org/2000/svg">
|
||||
<g transform="translate(-174.1 -145.01)">
|
||||
<path d="m174.1 177.65v-32.639h69.088v65.278h-69.088zm34.246 28.13c0.024-0.10478 0.15638-1.0668 0.29418-2.1378 0.21965-1.707 0.94032-7.2036 1.9094-14.563 0.16556-1.2573 0.52785-4.0196 0.80509-6.1383 0.27724-2.1188 0.52896-4.0333 0.55937-4.2545l0.0553-0.40217h-6.5185l-0.18248 1.3758c-0.50988 3.8444-1.9841 15.002-2.2122 16.743-0.14337 1.0943-0.46785 3.5708-0.72108 5.5033-0.25322 1.9325-0.482 3.6375-0.50841 3.7888l-0.048 0.27517h6.5238zm24.716-18.606c3.3379-3.9084 5.4177-8.681 6.1167-14.036 0.17198-1.3176 0.19855-4.6675 0.0468-5.9026-0.32589-2.6529-1.0286-5.3782-1.9596-7.6-1.1171-2.6658-3.0475-5.6301-5.0591-7.7684l-0.6472-0.68797-3.77 3.7672 0.61193 0.6836c0.95608 1.0681 1.2814 1.4867 2.0504 2.6382 1.6043 2.4024 2.7495 5.3112 3.2638 8.2901 0.25226 1.461 0.31337 4.4139 0.12354 5.969-0.54929 4.4999-2.5727 8.85-5.5824 12.002l-0.50538 0.5292 1.8973 1.9106 1.8973 1.9106 0.45054-0.49249c0.24779-0.27086 0.72711-0.81633 1.0652-1.2122zm-45.38-0.24704 1.8543-1.8557-0.61237-0.66313c-2.767-2.9964-4.6339-6.8607-5.3515-11.077-0.22317-1.3113-0.30461-3.9462-0.16506-5.3399 0.4529-4.5231 2.3622-8.882 5.3358-12.182 0.25382-0.28167 0.534-0.59499 0.62261-0.69626l0.16111-0.18414-3.7852-3.7408-0.61426 0.64323c-2.4773 2.5941-4.5952 6.1413-5.7596 9.6465-0.99952 3.0088-1.3953 5.4374-1.3934 8.5513 1e-3 2.4858 0.28501 4.6518 0.90981 6.9507 1.1123 4.0926 3.4445 8.2653 6.254 11.189 0.32439 0.33761 0.61226 0.61384 0.63971 0.61384 0.0275 0 0.88434-0.83507 1.9042-1.8557zm8.007-8.136c5.9e-4 -0.0238-0.2534-0.34768-0.56435-0.71967-1.4452-1.7289-2.3476-3.6184-2.7909-5.8441-0.20797-1.044-0.20976-3.344-3e-3 -4.3783 0.48288-2.4204 1.6614-4.7945 3.132-6.3095l0.35091-0.36149-3.691-3.6797-0.54882 0.59267c-2.4635 2.6603-4.0548 6.1357-4.5154 9.8614-0.13158 1.0644-0.10887 3.323 0.0444 4.4223 0.50881 3.6481 2.1306 7.0467 4.6547 9.7543l0.30888 0.33134 1.811-1.813c0.99603-0.99715 1.8114-1.8325 1.812-1.8563zm30.396 2.7315c2.519-2.9428 3.9175-6.3526 4.2425-10.345 0.3735-4.5873-1.4096-9.6838-4.5676-13.055l-0.56439-0.6025-1.852 1.8265-1.852 1.8265 0.52806 0.57547c1.394 1.5192 2.4638 3.6848 2.9403 5.9518 0.23237 1.1056 0.20682 3.6337-0.0487 4.8223-0.44548 2.072-1.3965 3.9927-2.7972 5.6496l-0.5142 0.60822 1.7868 1.826c0.98276 1.0043 1.8166 1.826 1.8531 1.826 0.0364 0 0.41686-0.40958 0.84537-0.91017zm-26.942-6.2251 1.0368-1.0392-0.46552-0.92925c-0.59961-1.1969-0.73239-1.7077-0.78366-3.0147-0.0641-1.6335 0.20895-2.7422 1.0054-4.0828l0.34635-0.58299-1.046-1.0485c-0.5753-0.57669-1.0845-1.0363-1.1316-1.0214-0.0471 0.0149-0.27115 0.29128-0.49792 0.61415-1.8748 2.6693-2.2919 6.424-1.0628 9.5681 0.40445 1.0347 1.3065 2.5759 1.5076 2.5759 0.0301 0 0.52126-0.46767 1.0915-1.0393zm20.567 0.48237c1.1344-1.6034 1.7577-3.6628 1.7535-5.7931-4e-3 -2.2003-0.62198-4.1696-1.8729-5.9716-0.17604-0.25359-0.35874-0.46152-0.406-0.46207-0.0473-5.9e-4 -0.55586 0.47005-1.1302 1.0458l-1.0442 1.0468 0.2097 0.3322c1.6087 2.5483 1.6062 5.5512-7e-3 8.054-0.11989 0.18604-0.0878 0.22963 0.92091 1.2499 0.57482 0.58143 1.0847 1.0442 1.133 1.0284 0.0484-0.0159 0.24757-0.25446 0.44269-0.53026zm-9.352-0.03c1.1785-0.30141 2.1343-0.90161 2.9733-1.8671 0.54006-0.6215 1.0938-1.6626 1.2824-2.4109 0.17186-0.68192 0.16775-2.2777-8e-3 -2.9545-0.52923-2.0425-2.198-3.708-4.2679-4.2594-0.74352-0.19808-2.2216-0.1978-2.9633 5.9e-4 -2.0768 0.55538-3.7414 2.2181-4.2937 4.289-0.19697 0.73844-0.1925 2.2167 9e-3 2.956 0.54543 2.002 2.2575 3.7257 4.2077 4.2364 0.85937 0.22504 2.2024 0.22945 3.0602 0.0101z" style="fill:#aa0000;stroke-width:.084667"/>
|
||||
</g>
|
||||
</svg>
|
||||
|
After Width: | Height: | Size: 3.6 KiB |
@@ -0,0 +1,80 @@
|
||||
import * as React from 'react'
|
||||
import { Link } from 'react-router-dom'
|
||||
|
||||
import './styles.scss'
|
||||
|
||||
interface IProps {
|
||||
big?: boolean
|
||||
primary?: boolean
|
||||
link?: boolean
|
||||
children?: any
|
||||
style?: string
|
||||
href?: string
|
||||
type?: string
|
||||
alt?: string
|
||||
onClick?: () => void
|
||||
}
|
||||
|
||||
export default class Button extends React.PureComponent<IProps> {
|
||||
static defaultProps = {}
|
||||
|
||||
render() {
|
||||
const {
|
||||
children,
|
||||
href,
|
||||
onClick,
|
||||
link,
|
||||
primary,
|
||||
big,
|
||||
type,
|
||||
alt,
|
||||
} = this.props
|
||||
let buttonEl = null
|
||||
if (type === 'submit') {
|
||||
buttonEl = (
|
||||
<input
|
||||
alt={alt}
|
||||
type="submit"
|
||||
value={children}
|
||||
className={`button ${primary ? 'primary' : ''} ${
|
||||
big ? 'big' : ''
|
||||
}`}
|
||||
/>
|
||||
)
|
||||
} else if (href && !link) {
|
||||
buttonEl = (
|
||||
<a
|
||||
href={href}
|
||||
className={`button ${primary ? 'primary' : ''} ${
|
||||
big ? 'big' : ''
|
||||
}`}
|
||||
>
|
||||
{children}
|
||||
</a>
|
||||
)
|
||||
} else if (href && link) {
|
||||
buttonEl = (
|
||||
<Link
|
||||
to={href}
|
||||
className={`button ${primary ? 'primary' : ''} ${
|
||||
big ? 'big' : ''
|
||||
}`}
|
||||
>
|
||||
{children}
|
||||
</Link>
|
||||
)
|
||||
} else {
|
||||
buttonEl = (
|
||||
<button
|
||||
className={`button ${primary ? 'primary' : ''} ${
|
||||
big ? 'big' : ''
|
||||
}`}
|
||||
onClick={onClick}
|
||||
>
|
||||
{children}
|
||||
</button>
|
||||
)
|
||||
}
|
||||
return <div className="button-wrapper">{buttonEl}</div>
|
||||
}
|
||||
}
|
||||
@@ -11,6 +11,17 @@
|
||||
background: #f2f2f2;
|
||||
cursor: pointer;
|
||||
}
|
||||
&.primary {
|
||||
color: white;
|
||||
background-color: var(--color-primary);
|
||||
&:hover {
|
||||
background-color: darken($color: #e90000, $amount: 5%);
|
||||
}
|
||||
}
|
||||
&.big {
|
||||
font-size: 26px;
|
||||
border-radius: 22px;
|
||||
}
|
||||
}
|
||||
|
||||
a,
|
||||
@@ -18,3 +29,12 @@ a,
|
||||
text-decoration: none !important;
|
||||
text-decoration-color: none !important;
|
||||
}
|
||||
|
||||
input,
|
||||
.button {
|
||||
outline: 0;
|
||||
border-spacing: 0;
|
||||
border-width: 0;
|
||||
text-decoration: none !important;
|
||||
text-decoration-color: none !important;
|
||||
}
|
||||
@@ -0,0 +1,131 @@
|
||||
import * as React from 'react'
|
||||
import {getPrettyDate, truncateString} from '../../utils'
|
||||
|
||||
import NoImage from '../../../images/no-cover-art.png'
|
||||
import PlayLogo from '../../../images/play-circle.svg'
|
||||
import PauseLogo from '../../../images/pause-circle.svg'
|
||||
import EarthLogo from '../../../images/earth.svg'
|
||||
|
||||
import './styles.scss'
|
||||
|
||||
|
||||
interface IProps {
|
||||
index?: number
|
||||
title?: string
|
||||
image?: any
|
||||
link?: string
|
||||
description?: string
|
||||
datePublished?: number
|
||||
onPlay?: any
|
||||
onPause?: any
|
||||
}
|
||||
|
||||
export default class EpisodeItem extends React.PureComponent<IProps> {
|
||||
state = {
|
||||
playing: false,
|
||||
playButtonSrc: PlayLogo,
|
||||
}
|
||||
|
||||
constructor(props) {
|
||||
super(props)
|
||||
// fix this in handlers
|
||||
this.togglePlayPause = this.togglePlayPause.bind(this)
|
||||
}
|
||||
|
||||
setPlaying(playing: boolean) {
|
||||
let button = PlayLogo
|
||||
if (playing) {
|
||||
button = PauseLogo
|
||||
}
|
||||
this.setState({
|
||||
playing: playing,
|
||||
playButtonSrc: button,
|
||||
})
|
||||
}
|
||||
|
||||
togglePlayPause() {
|
||||
if (this.state.playing) {
|
||||
if (this.props.onPause) {
|
||||
this.props.onPause()
|
||||
}
|
||||
this.pause()
|
||||
} else {
|
||||
if (this.props.onPlay) {
|
||||
this.props.onPlay(this.props.index)
|
||||
}
|
||||
this.play()
|
||||
}
|
||||
}
|
||||
|
||||
play() {
|
||||
this.setState({
|
||||
playing: true,
|
||||
playButtonSrc: PauseLogo,
|
||||
})
|
||||
}
|
||||
|
||||
pause() {
|
||||
this.setState({
|
||||
playing: false,
|
||||
playButtonSrc: PlayLogo,
|
||||
})
|
||||
}
|
||||
|
||||
render() {
|
||||
const {title, image, link, description, datePublished} = this.props
|
||||
const date = getPrettyDate(datePublished)
|
||||
const episodeLink = link
|
||||
return (
|
||||
<div className="episode">
|
||||
<div className="episode-row">
|
||||
<div className="episode-cover-art">
|
||||
<img
|
||||
alt="Episode cover art"
|
||||
draggable={false}
|
||||
src={image}
|
||||
onError={(ev: any) => {
|
||||
ev.target.src = NoImage
|
||||
}}
|
||||
/>
|
||||
</div>
|
||||
<div className="episode-info">
|
||||
<div className="episode-title">{title}</div>
|
||||
<p className="episode-date">
|
||||
<time dateTime={date}>{date}</time>
|
||||
</p>
|
||||
|
||||
<div className="episode-links">
|
||||
{episodeLink ?
|
||||
<a
|
||||
className="episode-link"
|
||||
href={episodeLink}
|
||||
title="Episode Website"
|
||||
target="_blank"
|
||||
>
|
||||
<img
|
||||
alt="Episode Website"
|
||||
src={EarthLogo}/>
|
||||
</a>
|
||||
: ""
|
||||
}
|
||||
|
||||
<img
|
||||
alt="Play/pause episode"
|
||||
className="episode-play-pause-mobile"
|
||||
src={this.state.playButtonSrc}
|
||||
onClick={this.togglePlayPause}/>
|
||||
</div>
|
||||
</div>
|
||||
<img
|
||||
alt="Play/pause episode"
|
||||
className="episode-play-pause"
|
||||
src={this.state.playButtonSrc}
|
||||
onClick={this.togglePlayPause}/>
|
||||
</div>
|
||||
<p className="episode-description">
|
||||
{truncateString(description).replace(/(<([^>]+)>)/gi, "")}
|
||||
</p>
|
||||
</div>
|
||||
)
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,121 @@
|
||||
.episode {
|
||||
background: #ffffff;
|
||||
border: 1px solid #d6d6d6;
|
||||
border-radius: 6px;
|
||||
margin: 10px 0px;
|
||||
height: auto;
|
||||
padding: 5px;
|
||||
box-sizing: border-box;
|
||||
}
|
||||
|
||||
.episode-row {
|
||||
display: flex;
|
||||
flex-direction: row;
|
||||
align-items: center;
|
||||
}
|
||||
|
||||
.episode-cover-art {
|
||||
display: inline-flex;
|
||||
flex-direction: column;
|
||||
align-items: center;
|
||||
justify-content: center;
|
||||
padding: 15px 15px 15px 15px;
|
||||
img {
|
||||
height: 140px;
|
||||
width: 140px;
|
||||
border-radius: 10px;
|
||||
border: 1px solid lighten(#d6d6d6, 0.2);
|
||||
}
|
||||
}
|
||||
|
||||
.episode-info {
|
||||
display: inline-flex;
|
||||
flex-direction: column;
|
||||
margin-left: 10px;
|
||||
p {
|
||||
margin: 10px 0;
|
||||
}
|
||||
}
|
||||
|
||||
.episode-title {
|
||||
font-family: var(--font-family-exp);
|
||||
font-weight: bold;
|
||||
width: 100%;
|
||||
font-size: 26px;
|
||||
color: #2d2d2d;
|
||||
text-align: left;
|
||||
}
|
||||
|
||||
.episode-date {
|
||||
color: #868686;
|
||||
}
|
||||
|
||||
.episode-links {
|
||||
display: inline-flex;
|
||||
flex-direction: row;
|
||||
}
|
||||
|
||||
.episode-link img, .episode-play-pause-mobile {
|
||||
width: 30px;
|
||||
height: 30px;
|
||||
}
|
||||
.episode-play-pause-mobile {
|
||||
display: none;
|
||||
margin-left: 20px;
|
||||
}
|
||||
|
||||
.episode-play-pause{
|
||||
margin-left: auto;
|
||||
margin-right: 10px;
|
||||
min-width: 50px;
|
||||
min-height: 50px;
|
||||
cursor: pointer;
|
||||
}
|
||||
|
||||
.episode-description {
|
||||
font-family: var(--font-family);
|
||||
overflow: hidden;
|
||||
text-overflow: ellipsis;
|
||||
font-size: 18px;
|
||||
margin: 0 !important;
|
||||
padding: 10px;
|
||||
}
|
||||
|
||||
@media only screen and (max-width: 767px) {
|
||||
/* phones */
|
||||
.episode-row {
|
||||
// height: 170px;
|
||||
}
|
||||
.episode {
|
||||
height: fit-content;
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
align-items: flex-start;
|
||||
padding: 10px 10px;
|
||||
}
|
||||
.episode-cover-art {
|
||||
img {
|
||||
height: 90px;
|
||||
width: 90px;
|
||||
}
|
||||
}
|
||||
|
||||
.episode-title {
|
||||
width: 100%;
|
||||
font-size: 22px;
|
||||
}
|
||||
.episode-play-pause-mobile {
|
||||
display: inherit;
|
||||
}
|
||||
.episode-play-pause{
|
||||
display: none;
|
||||
}
|
||||
.episode-description {
|
||||
font-size: 15px;
|
||||
}
|
||||
.episode-info {
|
||||
p {
|
||||
font-size: 15px;
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,153 @@
|
||||
import * as React from 'react'
|
||||
import AudioPlayer from 'react-h5-audio-player'
|
||||
import {Link} from "react-router-dom";
|
||||
import {getPrettyDate} from "../../utils";
|
||||
|
||||
import 'react-h5-audio-player/src/styles.scss'
|
||||
import './styles.scss'
|
||||
|
||||
interface IProps {
|
||||
episode?: any
|
||||
onPlay?: any
|
||||
onPause?: any
|
||||
onCanPlay?: any
|
||||
}
|
||||
|
||||
export default class Player extends React.Component<IProps> {
|
||||
state = {
|
||||
playing: false,
|
||||
}
|
||||
|
||||
player = React.createRef<AudioPlayer>()
|
||||
|
||||
constructor(props: IProps) {
|
||||
super(props)
|
||||
// fix this in handlers
|
||||
this.onCanPlay = this.onCanPlay.bind(this)
|
||||
this.onPlay = this.onPlay.bind(this)
|
||||
this.onPause = this.onPause.bind(this)
|
||||
}
|
||||
|
||||
onCanPlay() {
|
||||
if (this.props.onCanPlay){
|
||||
this.props.onCanPlay()
|
||||
}
|
||||
}
|
||||
|
||||
play(){
|
||||
this.player.current.audio.current.play()
|
||||
}
|
||||
|
||||
pause(){
|
||||
this.player.current.audio.current.pause()
|
||||
}
|
||||
|
||||
onPlay() {
|
||||
if (this.props.onPlay){
|
||||
this.props.onPlay()
|
||||
}
|
||||
this.setState({
|
||||
playing: true,
|
||||
})
|
||||
}
|
||||
|
||||
onPause() {
|
||||
if (this.props.onPause){
|
||||
this.props.onPause()
|
||||
}
|
||||
this.setState({
|
||||
playing: false,
|
||||
})
|
||||
}
|
||||
|
||||
componentDidMount() {
|
||||
this.setMediaSessionActionHandlers();
|
||||
}
|
||||
|
||||
componentDidUpdate() {
|
||||
this.setMediaSessionMetadata();
|
||||
}
|
||||
|
||||
setMediaSessionActionHandlers() {
|
||||
let navigator: any = window.navigator;
|
||||
if('mediaSession' in window.navigator) {
|
||||
navigator.mediaSession.setActionHandler('seekbackward', () => this.seekBackward());
|
||||
navigator.mediaSession.setActionHandler('seekforward', () => this.seekForward());
|
||||
}
|
||||
}
|
||||
|
||||
seekBackward() {
|
||||
let audio = this.player.current.audio.current;
|
||||
audio.currentTime = Math.max(0, audio.currentTime - 5);
|
||||
}
|
||||
|
||||
seekForward() {
|
||||
let audio = this.player.current.audio.current;
|
||||
audio.currentTime = Math.min(audio.duration, audio.currentTime + 5);
|
||||
}
|
||||
|
||||
setMediaSessionMetadata() {
|
||||
let navigator: any = window.navigator;
|
||||
let episode = this.props.episode;
|
||||
let image: string = episode.image || episode.feedImage;
|
||||
if(episode && 'mediaSession' in window.navigator) {
|
||||
// @ts-ignore
|
||||
navigator.mediaSession.metadata = new MediaMetadata({
|
||||
title: episode.title,
|
||||
artist: episode.feedTitle,
|
||||
...(image &&
|
||||
{
|
||||
artwork: [{ src: image, sizes: '512x512'}]
|
||||
}
|
||||
)
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
render() {
|
||||
const {episode} = this.props
|
||||
const date = getPrettyDate(episode.datePublished)
|
||||
return (
|
||||
<div className="player-media-controls">
|
||||
<AudioPlayer
|
||||
ref={this.player}
|
||||
header={
|
||||
<div className="player-info">
|
||||
<div className="player-show-title">
|
||||
<p title={episode.title}>{episode.title}</p>
|
||||
</div>
|
||||
<div className="player-podcast-name">
|
||||
{episode.feedTitle !== undefined ?
|
||||
<Link to={`/podcast/${episode.feedId}`} title={episode.feedTitle}>
|
||||
from: {episode.feedTitle}
|
||||
</Link>
|
||||
: ""
|
||||
}
|
||||
</div>
|
||||
<p>
|
||||
<time dateTime={date}>{date}</time>
|
||||
</p>
|
||||
</div>
|
||||
}
|
||||
autoPlayAfterSrcChange={false}
|
||||
autoPlay={false}
|
||||
src={episode.enclosureUrl}
|
||||
onCanPlay={this.onCanPlay}
|
||||
onPlay={this.onPlay}
|
||||
onPause={this.onPause}
|
||||
onEnded={this.onPause}
|
||||
customAdditionalControls={[
|
||||
<a
|
||||
className="player-feed-button"
|
||||
// href={}
|
||||
style={{width: 30}}
|
||||
>
|
||||
{/* <img src={FeedIcon} /> */}
|
||||
</a>,
|
||||
]}
|
||||
|
||||
/>
|
||||
</div>
|
||||
)
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,83 @@
|
||||
.player-info {
|
||||
display: inline-flex;
|
||||
flex-direction: column;
|
||||
align-items: center;
|
||||
width: 100%;
|
||||
}
|
||||
|
||||
.player-bottom {
|
||||
display: inline-flex;
|
||||
flex-direction: column;
|
||||
align-items: center;
|
||||
width: inherit;
|
||||
margin-top: 5px;
|
||||
padding: 0 10px;
|
||||
// width: calc100%;
|
||||
}
|
||||
|
||||
.player-media-controls {
|
||||
width: calc(100% - 20px);
|
||||
.player-show-title p {
|
||||
font-size: 20px;
|
||||
font-family: var(--font-family);
|
||||
font-weight: bold;
|
||||
text-align: center;
|
||||
width: 450px;
|
||||
white-space: nowrap;
|
||||
overflow: hidden;
|
||||
text-overflow: ellipsis;
|
||||
margin-bottom: 5px;
|
||||
color: #2d2d2d;
|
||||
}
|
||||
.player-podcast-name a {
|
||||
font-size: 16px;
|
||||
font-family: var(--font-family);
|
||||
text-align: center;
|
||||
width: 450px;
|
||||
white-space: nowrap;
|
||||
overflow: hidden;
|
||||
text-overflow: ellipsis;
|
||||
color: #2d2d2d;
|
||||
margin-bottom: 5px;
|
||||
}
|
||||
.player-feed-button {
|
||||
cursor: pointer;
|
||||
}
|
||||
p {
|
||||
margin: 5px 0 0;
|
||||
font-family: var(--font-family-exp);
|
||||
font-size: 14px;
|
||||
//line-height: 16px;
|
||||
color: #868686;
|
||||
}
|
||||
.rhap_container {
|
||||
outline: none;
|
||||
box-shadow: none;
|
||||
button {
|
||||
outline: none;
|
||||
}
|
||||
.rhap_volume-bar-area {
|
||||
outline: none;
|
||||
}
|
||||
.rhap_progress-container {
|
||||
outline: none;
|
||||
}
|
||||
.rhap_progress-indicator {
|
||||
width: 15px;
|
||||
height: 15px;
|
||||
top: -5px;
|
||||
background: var(--color-primary);
|
||||
}
|
||||
.rhap_play-pause-button {
|
||||
svg path {
|
||||
fill: var(--color-primary);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@media only screen and (max-width: 520px) {
|
||||
.player-show-title p {
|
||||
max-width: 350px;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,98 @@
|
||||
import * as React from 'react'
|
||||
|
||||
import NoImage from '../../../images/no-cover-art.png'
|
||||
import {truncateString} from '../../utils'
|
||||
import RSSLogo from "../../../images/feed.svg";
|
||||
import EarthLogo from "../../../images/earth.svg";
|
||||
import './styles.scss'
|
||||
|
||||
interface IProps {
|
||||
title?: string
|
||||
description?: string
|
||||
author?: string
|
||||
categories?: any
|
||||
image?: any
|
||||
id?: string
|
||||
feedURL?: string
|
||||
podcastURL?: string
|
||||
}
|
||||
|
||||
export default class PodcastHeader extends React.PureComponent<IProps> {
|
||||
|
||||
renderCategories(categories) {
|
||||
let categoryArray = []
|
||||
// categories = {
|
||||
// '': '',
|
||||
// '9': 'Business',
|
||||
// }
|
||||
for (let prop in categories) {
|
||||
let category = categories[prop]
|
||||
if (category !== '') {
|
||||
categoryArray.push(category)
|
||||
}
|
||||
}
|
||||
if (categoryArray.length === 0) {
|
||||
return (
|
||||
<div className="podcast-header-category no-category">No Categories</div>
|
||||
)
|
||||
}
|
||||
// Only render a max of 5 categories
|
||||
return categoryArray.slice(0, 5).map((cat, i) => (
|
||||
<div key={`cat-${i}`} className="podcast-header-category">
|
||||
{cat}
|
||||
</div>
|
||||
))
|
||||
}
|
||||
|
||||
render() {
|
||||
const {title, description, author, categories, image, feedURL, podcastURL} = this.props
|
||||
return (
|
||||
<div className="podcast-header">
|
||||
<h1 className="podcast-header-title">{title}</h1>
|
||||
<div className="podcast-header-row">
|
||||
<div className="podcast-header-cover-art">
|
||||
<img
|
||||
draggable={false}
|
||||
src={image}
|
||||
onError={(ev: any) => {
|
||||
ev.target.src = NoImage
|
||||
}}
|
||||
/>
|
||||
</div>
|
||||
<div className="podcast-header-info">
|
||||
<address>By: {author}</address>
|
||||
<div className="podcast-header-categories">
|
||||
{this.renderCategories(categories)}
|
||||
</div>
|
||||
<p className="podcast-header-description">
|
||||
{truncateString(description)}
|
||||
</p>
|
||||
<div className="podcast-header-external-links">
|
||||
{podcastURL ?
|
||||
<a
|
||||
href={podcastURL}
|
||||
title="Podcast Website"
|
||||
target="_blank"
|
||||
>
|
||||
<img
|
||||
src={EarthLogo}/>
|
||||
</a>
|
||||
: ""
|
||||
}
|
||||
{feedURL ?
|
||||
<a
|
||||
href={feedURL}
|
||||
title="RSS Feed"
|
||||
target="_blank"
|
||||
>
|
||||
<img src={RSSLogo}/>
|
||||
</a>
|
||||
: ""
|
||||
}
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
)
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,152 @@
|
||||
.podcast-header {
|
||||
//background: #ffffff;
|
||||
//border: 1px solid #d6d6d6;
|
||||
//border-radius: 6px;
|
||||
//margin: 10px 20px;
|
||||
//height: auto;
|
||||
//padding: 5px;
|
||||
}
|
||||
|
||||
.podcast-header-row {
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
align-items: flex-start;
|
||||
flex-direction: row;
|
||||
}
|
||||
|
||||
.podcast-header-cover-art {
|
||||
display: inline-flex;
|
||||
flex-direction: column;
|
||||
justify-content: center;
|
||||
img {
|
||||
height: 300px;
|
||||
width: 300px;
|
||||
border-radius: 10px;
|
||||
border: 1px solid lighten(#d6d6d6, 0.2);
|
||||
}
|
||||
}
|
||||
|
||||
.podcast-header-info {
|
||||
margin-left: 20px;
|
||||
p {
|
||||
margin: 10px 0;
|
||||
}
|
||||
margin-right: 15px;
|
||||
address {
|
||||
font-size: 20px;
|
||||
}
|
||||
width: 100%;
|
||||
}
|
||||
|
||||
.podcast-header-title {
|
||||
font-family: var(--font-family-exp);
|
||||
font-weight: bold;
|
||||
width: 100%;
|
||||
font-size: 45px;
|
||||
color: #2d2d2d;
|
||||
text-align: left;
|
||||
margin-top: 0;
|
||||
}
|
||||
|
||||
.podcast-header-categories {
|
||||
margin-top: 10px;
|
||||
margin-bottom: 10px;
|
||||
display: inline-flex;
|
||||
flex-direction: row;
|
||||
flex-wrap: wrap;
|
||||
justify-content: flex-start;
|
||||
align-items: flex-start;
|
||||
&::-webkit-scrollbar {
|
||||
visibility: hidden;
|
||||
}
|
||||
}
|
||||
.podcast-header-category {
|
||||
background: #f3f3f3;
|
||||
border: 1px solid #cecece;
|
||||
border-radius: 5px;
|
||||
margin: 3px;
|
||||
|
||||
padding: 4px 12px;
|
||||
}
|
||||
.no-category {
|
||||
opacity: 0.6;
|
||||
}
|
||||
|
||||
.podcast-header-external-links {
|
||||
margin-top: 10px;
|
||||
margin-bottom: 10px;
|
||||
display: inline-flex;
|
||||
flex-direction: row;
|
||||
flex-wrap: wrap;
|
||||
justify-content: flex-start;
|
||||
align-items: flex-start;
|
||||
&::-webkit-scrollbar {
|
||||
visibility: hidden;
|
||||
}
|
||||
|
||||
img {
|
||||
width: 35px;
|
||||
height: 35px;
|
||||
}
|
||||
}
|
||||
|
||||
.podcast-header-description {
|
||||
font-family: var(--font-family);
|
||||
overflow: hidden;
|
||||
text-overflow: ellipsis;
|
||||
font-size: 18px;
|
||||
margin: 0 !important;
|
||||
//padding: 10px;
|
||||
}
|
||||
|
||||
@media only screen and (max-width: 767px) {
|
||||
/* phones */
|
||||
.podcast-header-row {
|
||||
// height: 170px;
|
||||
}
|
||||
.podcast-header {
|
||||
height: fit-content;
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
align-items: flex-start;
|
||||
padding: 10px 10px;
|
||||
}
|
||||
.podcast-header-cover-art {
|
||||
img {
|
||||
height: 150px;
|
||||
width: 150px;
|
||||
}
|
||||
}
|
||||
|
||||
.podcast-header-title {
|
||||
width: 100%;
|
||||
font-size: 35px;
|
||||
}
|
||||
.podcast-header-description {
|
||||
font-size: 15px;
|
||||
}
|
||||
.podcast-header-info {
|
||||
p {
|
||||
font-size: 15px;
|
||||
}
|
||||
}
|
||||
.podcast-header-categories {
|
||||
display: inline-flex;
|
||||
flex-direction: row;
|
||||
flex-wrap: wrap;
|
||||
justify-content: flex-start;
|
||||
align-items: flex-start;
|
||||
&::-webkit-scrollbar {
|
||||
visibility: hidden;
|
||||
}
|
||||
}
|
||||
.podcast-header-category {
|
||||
font-size: 14px;
|
||||
background: #f3f3f3;
|
||||
border: 1px solid #cecece;
|
||||
border-radius: 5px;
|
||||
margin: 3px;
|
||||
|
||||
padding: 4px 12px;
|
||||
}
|
||||
}
|
||||
@@ -1,31 +1,30 @@
|
||||
import * as React from 'react'
|
||||
import AudioPlayer from 'react-h5-audio-player'
|
||||
import ReactLoading from 'react-loading'
|
||||
|
||||
// import FeedIcon from '../../../images/feed.svg'
|
||||
import Player from "../Player";
|
||||
import BackIcon from '../../../images/chevron-back-outline.svg'
|
||||
import NoImage from '../../../images/no-cover-art.png'
|
||||
import ForwardIcon from '../../../images/chevron-forward-outline.svg'
|
||||
import 'react-h5-audio-player/src/styles.scss'
|
||||
import './styles.scss'
|
||||
import {Link} from "react-router-dom";
|
||||
|
||||
interface IProps {
|
||||
title?: string
|
||||
podcasts?: Array<any>
|
||||
loading?: boolean
|
||||
}
|
||||
|
||||
interface IState {
|
||||
index: number
|
||||
}
|
||||
|
||||
export default class PodcastPlayer extends React.Component<IProps, IState> {
|
||||
export default class RecentPodcasts extends React.Component<IProps, IState> {
|
||||
static defaultProps = {}
|
||||
state = {
|
||||
index: 0,
|
||||
}
|
||||
|
||||
player = React.createRef()
|
||||
|
||||
constructor(props: IProps) {
|
||||
super(props)
|
||||
}
|
||||
@@ -33,12 +32,12 @@ export default class PodcastPlayer extends React.Component<IProps, IState> {
|
||||
selectPodcast(index: number, evt) {
|
||||
evt.stopPropagation()
|
||||
evt.preventDefault()
|
||||
this.setState({ index })
|
||||
this.setState({index})
|
||||
}
|
||||
|
||||
onBack() {
|
||||
const { index } = this.state
|
||||
const { podcasts } = this.props
|
||||
const {index} = this.state
|
||||
const {podcasts} = this.props
|
||||
let backIndex = index - 1
|
||||
if (backIndex < 0) {
|
||||
backIndex = podcasts.length - 1
|
||||
@@ -49,8 +48,8 @@ export default class PodcastPlayer extends React.Component<IProps, IState> {
|
||||
}
|
||||
|
||||
onForward() {
|
||||
const { index } = this.state
|
||||
const { podcasts } = this.props
|
||||
const {index} = this.state
|
||||
const {podcasts} = this.props
|
||||
let nextIndex = index + 1
|
||||
if (nextIndex >= podcasts.length) {
|
||||
nextIndex = 0
|
||||
@@ -61,14 +60,14 @@ export default class PodcastPlayer extends React.Component<IProps, IState> {
|
||||
}
|
||||
|
||||
render() {
|
||||
const { loading, title, podcasts } = this.props
|
||||
const { index } = this.state
|
||||
const {loading, title, podcasts} = this.props
|
||||
const {index} = this.state
|
||||
const selectedPodcast = podcasts[index]
|
||||
return (
|
||||
<div className="player-card">
|
||||
{loading ? (
|
||||
<div className="loader-wrapper">
|
||||
<ReactLoading type="cylon" color="#e90000" />
|
||||
<ReactLoading type="cylon" color="#e90000"/>
|
||||
</div>
|
||||
) : (
|
||||
<div className="player">
|
||||
@@ -77,13 +76,13 @@ export default class PodcastPlayer extends React.Component<IProps, IState> {
|
||||
className="player-nav-arrows-left"
|
||||
onClick={this.onBack.bind(this)}
|
||||
>
|
||||
<img src={BackIcon} height={20} />
|
||||
<img src={BackIcon} height={20}/>
|
||||
</button>
|
||||
<button
|
||||
className="player-nav-arrows-right"
|
||||
onClick={this.onForward.bind(this)}
|
||||
>
|
||||
<img src={ForwardIcon} height={20} />
|
||||
<img src={ForwardIcon} height={20}/>
|
||||
</button>
|
||||
</div>
|
||||
{title && (
|
||||
@@ -92,13 +91,15 @@ export default class PodcastPlayer extends React.Component<IProps, IState> {
|
||||
</div>
|
||||
)}
|
||||
<div className="player-cover-art">
|
||||
<img
|
||||
draggable={false}
|
||||
src={selectedPodcast.image || NoImage}
|
||||
onError={(ev: any) => {
|
||||
ev.target.src = NoImage
|
||||
}}
|
||||
/>
|
||||
<Link to={`/podcast/${selectedPodcast.feedId}`}>
|
||||
<img
|
||||
draggable={false}
|
||||
src={selectedPodcast.image || selectedPodcast.feedImage || NoImage}
|
||||
onError={(ev: any) => {
|
||||
ev.target.src = NoImage
|
||||
}}
|
||||
/>
|
||||
</Link>
|
||||
</div>
|
||||
<div className="player-bottom">
|
||||
<div className="player-carousel">
|
||||
@@ -116,35 +117,7 @@ export default class PodcastPlayer extends React.Component<IProps, IState> {
|
||||
></button>
|
||||
))}
|
||||
</div>
|
||||
<div className="player-media-controls">
|
||||
<AudioPlayer
|
||||
header={
|
||||
<div className="player-info">
|
||||
<div className="player-show-title">
|
||||
<b>{selectedPodcast.title}</b>
|
||||
</div>
|
||||
<p>
|
||||
{
|
||||
selectedPodcast.datePublishedPretty
|
||||
}
|
||||
</p>
|
||||
</div>
|
||||
}
|
||||
autoPlayAfterSrcChange={false}
|
||||
autoPlay={false}
|
||||
src={selectedPodcast.enclosureUrl}
|
||||
// showJumpControls={false}
|
||||
customAdditionalControls={[
|
||||
<a
|
||||
className="player-feed-button"
|
||||
// href={}
|
||||
style={{ width: 30 }}
|
||||
>
|
||||
{/* <img src={FeedIcon} /> */}
|
||||
</a>,
|
||||
]}
|
||||
/>
|
||||
</div>
|
||||
<Player episode={selectedPodcast}/>
|
||||
</div>
|
||||
</div>
|
||||
)}
|
||||
@@ -2,15 +2,14 @@
|
||||
background: #ffffff;
|
||||
width: 500px;
|
||||
height: auto;
|
||||
min-height: 500px;
|
||||
min-height: 660px;
|
||||
border: 1px solid #d6d6d6;
|
||||
box-shadow: 0 0 9px 0 rgba(192, 192, 192, 0.5);
|
||||
border-radius: 12px;
|
||||
transition: var(--transition-secs);
|
||||
// &:hover {
|
||||
// transition: var(--transition-secs);
|
||||
// box-shadow: 0 0 9px 0 rgba(192, 192, 192, 0.8);
|
||||
// }
|
||||
.loader-wrapper {
|
||||
height: 660px;
|
||||
}
|
||||
}
|
||||
.player {
|
||||
flex: 1;
|
||||
@@ -35,7 +34,7 @@
|
||||
position: absolute;
|
||||
z-index: 0;
|
||||
width: inherit;
|
||||
height: 500px;
|
||||
height: 510px;
|
||||
button {
|
||||
outline: 0;
|
||||
border: 0;
|
||||
@@ -106,83 +105,26 @@
|
||||
img {
|
||||
width: 450px;
|
||||
height: 450px;
|
||||
border-radius: 10px;
|
||||
border-radius: 14px;
|
||||
border: 1px solid lighten(#d6d6d6, 0.2);
|
||||
}
|
||||
}
|
||||
|
||||
.player-info {
|
||||
display: inline-flex;
|
||||
flex-direction: column;
|
||||
align-items: center;
|
||||
width: 100%;
|
||||
}
|
||||
|
||||
.player-bottom {
|
||||
display: inline-flex;
|
||||
flex-direction: column;
|
||||
align-items: center;
|
||||
width: inherit;
|
||||
margin-top: 5px;
|
||||
padding: 0 10px;
|
||||
// width: calc100%;
|
||||
}
|
||||
|
||||
.player-media-controls {
|
||||
width: calc(100% - 20px);
|
||||
.player-show-title {
|
||||
font-size: 20px;
|
||||
font-family: var(--font-family);
|
||||
text-align: center;
|
||||
width: 450px;
|
||||
white-space: nowrap;
|
||||
overflow: hidden;
|
||||
text-overflow: ellipsis;
|
||||
}
|
||||
.player-feed-button {
|
||||
cursor: pointer;
|
||||
}
|
||||
p {
|
||||
margin: 0;
|
||||
margin-top: 5px;
|
||||
font-family: var(--font-family-exp);
|
||||
font-size: 14px;
|
||||
line-height: 14px;
|
||||
color: #868686;
|
||||
}
|
||||
.rhap_container {
|
||||
outline: none;
|
||||
box-shadow: none;
|
||||
button {
|
||||
outline: none;
|
||||
}
|
||||
.rhap_volume-bar-area {
|
||||
outline: none;
|
||||
}
|
||||
.rhap_progress-container {
|
||||
outline: none;
|
||||
}
|
||||
.rhap_progress-indicator {
|
||||
width: 15px;
|
||||
height: 15px;
|
||||
top: -5px;
|
||||
background: var(--color-primary);
|
||||
}
|
||||
.rhap_play-pause-button {
|
||||
svg path {
|
||||
fill: var(--color-primary);
|
||||
}
|
||||
}
|
||||
}
|
||||
z-index: 99999;
|
||||
}
|
||||
|
||||
@media only screen and (max-width: 520px) {
|
||||
/* portrait phones */
|
||||
.player-card {
|
||||
width: calc(100% - 20px);
|
||||
margin: 0 10px;
|
||||
min-width: 350px;
|
||||
height: auto;
|
||||
margin: 0 auto;
|
||||
width: 340px;
|
||||
min-height: 480px;
|
||||
height: 525px;
|
||||
}
|
||||
.player-info {
|
||||
.player-show-title {
|
||||
p {
|
||||
width: 300px;
|
||||
}
|
||||
}
|
||||
}
|
||||
.player-cover-art {
|
||||
display: inline-flex;
|
||||
@@ -190,17 +132,17 @@
|
||||
align-items: center;
|
||||
justify-content: center;
|
||||
width: calc(100% - 20px);
|
||||
padding: 0 10px;
|
||||
height: auto;
|
||||
// padding: 25px 25px 0 25px;
|
||||
img {
|
||||
a {
|
||||
width: inherit;
|
||||
height: inherit;
|
||||
}
|
||||
img {
|
||||
width: 275px;
|
||||
height: 275px;
|
||||
border-radius: 10px;
|
||||
border: 1px solid lighten(#d6d6d6, 0.2);
|
||||
}
|
||||
}
|
||||
.player-show-title {
|
||||
max-width: 350px;
|
||||
}
|
||||
}
|
||||
@@ -1,5 +1,7 @@
|
||||
import * as React from 'react'
|
||||
|
||||
import {Link} from "react-router-dom";
|
||||
import {truncateString} from '../../utils'
|
||||
import NoImage from '../../../images/no-cover-art.png'
|
||||
|
||||
import './styles.scss'
|
||||
@@ -10,6 +12,7 @@ interface IProps {
|
||||
author?: string
|
||||
categories?: any
|
||||
image?: any
|
||||
id?: string
|
||||
}
|
||||
|
||||
export default class ResultItem extends React.PureComponent<IProps> {
|
||||
@@ -44,26 +47,25 @@ export default class ResultItem extends React.PureComponent<IProps> {
|
||||
))
|
||||
}
|
||||
|
||||
truncate = (input: string) =>
|
||||
input.length > 200 ? `${input.substring(0, 300)}...` : input
|
||||
|
||||
render() {
|
||||
const { title, description, author, categories, image } = this.props
|
||||
const {title, description, author, categories, image, id} = this.props
|
||||
// const { open } = this.state
|
||||
return (
|
||||
<div className="result">
|
||||
<div className="result-row">
|
||||
<div className="result-cover-art">
|
||||
<img
|
||||
draggable={false}
|
||||
src={image}
|
||||
onError={(ev: any) => {
|
||||
ev.target.src = NoImage
|
||||
}}
|
||||
/>
|
||||
<Link to={`/podcast/${id}`}>
|
||||
<img
|
||||
draggable={false}
|
||||
src={image}
|
||||
onError={(ev: any) => {
|
||||
ev.target.src = NoImage
|
||||
}}
|
||||
/>
|
||||
</Link>
|
||||
</div>
|
||||
<div className="result-info">
|
||||
<div className="result-title">{title}</div>
|
||||
<div className="result-title"><Link to={`/podcast/${id}`}>{title}</Link></div>
|
||||
<p>by {author}</p>
|
||||
<div className="result-categories">
|
||||
{this.renderCategories(categories)}
|
||||
@@ -71,7 +73,7 @@ export default class ResultItem extends React.PureComponent<IProps> {
|
||||
</div>
|
||||
</div>
|
||||
<p className="result-description">
|
||||
{this.truncate(description)}
|
||||
{truncateString(description)}
|
||||
</p>
|
||||
</div>
|
||||
)
|
||||
@@ -38,7 +38,7 @@
|
||||
margin-right: 15px;
|
||||
}
|
||||
|
||||
.result-title {
|
||||
.result-title, .result-title a {
|
||||
font-family: var(--font-family-exp);
|
||||
font-weight: bold;
|
||||
width: 100%;
|
||||
@@ -0,0 +1,54 @@
|
||||
import * as React from 'react'
|
||||
import Avatar from '../../../images/pci_avatar.jpg'
|
||||
|
||||
import './styles.scss'
|
||||
|
||||
interface SphinxWidgetProps
|
||||
extends React.DetailedHTMLProps<
|
||||
React.HTMLAttributes<HTMLElement>,
|
||||
HTMLElement
|
||||
> {
|
||||
pubkey: string
|
||||
title: string
|
||||
subtitle: string
|
||||
name: string
|
||||
amount: string
|
||||
imgurl: string
|
||||
}
|
||||
|
||||
declare global {
|
||||
namespace JSX {
|
||||
interface IntrinsicElements {
|
||||
'sphinx-widget': SphinxWidgetProps
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
interface IProps {}
|
||||
|
||||
export default class SphinxChat extends React.PureComponent<IProps> {
|
||||
constructor(props: IProps) {
|
||||
super(props)
|
||||
}
|
||||
|
||||
componentDidMount() {
|
||||
// load the external script
|
||||
const script = document.createElement('script')
|
||||
script.src = 'https://sphinx.chat/donation/widget.js'
|
||||
script.async = true
|
||||
document.body.appendChild(script)
|
||||
}
|
||||
|
||||
render() {
|
||||
return (
|
||||
<sphinx-widget
|
||||
pubkey="036557ea56b3b86f08be31bcd2557cae8021b0e3a9413f0c0e52625c6696972e57"
|
||||
title="Value 4 Value Support"
|
||||
subtitle="Put in what you get out of this"
|
||||
name="Podcast Index LLC"
|
||||
amount="10000"
|
||||
imgurl={Avatar}
|
||||
></sphinx-widget>
|
||||
)
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,8 @@
|
||||
// Mobile resize
|
||||
@media only screen and (max-width: 767px) {
|
||||
sphinx-widget {
|
||||
> div {
|
||||
width: 300px !important;
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -4,7 +4,8 @@ import { history } from '../../state/store'
|
||||
|
||||
import Button from '../Button'
|
||||
import Searchbar from '../SearchBar'
|
||||
import Icon from '../../../images/icon.svg'
|
||||
import BrandIcon from '../../../images/brand-icon.svg'
|
||||
import BrandName from '../../../images/brand-text.svg'
|
||||
import MenuIcon from '../../../images/menu.svg'
|
||||
import { cleanSearchQuery } from '../../utils'
|
||||
|
||||
@@ -50,13 +51,19 @@ export default class Topbar extends React.PureComponent<IProps, IState> {
|
||||
}
|
||||
|
||||
render() {
|
||||
const { history } = this.props
|
||||
const { search, dropdownOpen } = this.state
|
||||
return (
|
||||
<nav className="topbar">
|
||||
<Link className="topbar-brand" to="/">
|
||||
<img height={30} width={28} src={Icon} alt="Sidebar logo" />
|
||||
<div className="topbar-title">Podcast Index</div>{' '}
|
||||
<img
|
||||
// height={38}
|
||||
width={36}
|
||||
src={BrandIcon}
|
||||
alt="Brand logo"
|
||||
/>
|
||||
<div className="topbar-title">
|
||||
<img src={BrandName} width={230} alt="Brand name" />
|
||||
</div>
|
||||
</Link>
|
||||
<div className="topbar-span">
|
||||
<Searchbar
|
||||
@@ -72,14 +79,18 @@ export default class Topbar extends React.PureComponent<IProps, IState> {
|
||||
dropdownOpen ? 'topbar-dropdown-open' : ''
|
||||
}`}
|
||||
>
|
||||
<Button link href="/stats">
|
||||
{/* <Button link href="/stats">
|
||||
Stats
|
||||
</Button>
|
||||
<Button href="https://podcastindex.org/blog">
|
||||
</Button> */}
|
||||
<Button href="/apps">Apps</Button>
|
||||
<Button href="https://blog.podcastindex.org/">
|
||||
Blog
|
||||
</Button>
|
||||
<Button href="https://podcastindex-org.github.io/docs-api/">
|
||||
Documentation
|
||||
</Button>
|
||||
<Button href="https://api.podcastindex.org">
|
||||
Login
|
||||
Developer Login
|
||||
</Button>
|
||||
</div>
|
||||
<a
|
||||
@@ -3,12 +3,14 @@
|
||||
flex-direction: row;
|
||||
justify-content: space-between;
|
||||
position: sticky;
|
||||
padding: 23px 25px;
|
||||
padding: 23px 0;
|
||||
z-index: 3;
|
||||
width: 90%;
|
||||
margin: 10px auto;
|
||||
}
|
||||
|
||||
.topbar-brand {
|
||||
width: 270px;
|
||||
width: 290px;
|
||||
display: inline-flex;
|
||||
flex-direction: row;
|
||||
align-items: center;
|
||||
@@ -22,15 +24,15 @@ a,
|
||||
}
|
||||
|
||||
.topbar-title {
|
||||
font-family: var(--font-family-bold);
|
||||
font-weight: bold;
|
||||
font-size: 26px;
|
||||
text-transform: uppercase;
|
||||
display: inline-flex;
|
||||
flex-direction: row;
|
||||
align-items: center;
|
||||
margin-left: 15px;
|
||||
color: var(--color-primary);
|
||||
}
|
||||
|
||||
.topbar-span {
|
||||
margin-top: 5px;
|
||||
flex: 3;
|
||||
display: inline-flex;
|
||||
flex-direction: row;
|
||||
@@ -38,7 +40,7 @@ a,
|
||||
}
|
||||
|
||||
.topbar-links {
|
||||
flex: 1;
|
||||
margin-top: 5px;
|
||||
display: inline-flex;
|
||||
flex-direction: row;
|
||||
align-items: center;
|
||||
@@ -60,7 +62,17 @@ a,
|
||||
background: lighten(#d6d6d6, 0.2);
|
||||
}
|
||||
}
|
||||
|
||||
@media only screen and (max-width: 980px) {
|
||||
.topbar {
|
||||
//padding: 23px 15px;
|
||||
}
|
||||
.topbar-brand {
|
||||
width: 40px;
|
||||
}
|
||||
.topbar-title {
|
||||
display: none;
|
||||
}
|
||||
}
|
||||
@media only screen and (max-width: 860px) {
|
||||
.topbar-links {
|
||||
flex: 0;
|
||||
@@ -100,9 +112,9 @@ a,
|
||||
.topbar-brand {
|
||||
width: 40px;
|
||||
}
|
||||
.topbar-title {
|
||||
display: none;
|
||||
}
|
||||
// .topbar-title {
|
||||
// display: none;
|
||||
// }
|
||||
.landing-content {
|
||||
min-width: 600px;
|
||||
width: 600px;
|
||||
@@ -13,6 +13,11 @@ declare module '*.png' {
|
||||
export default content
|
||||
}
|
||||
|
||||
declare module '*.jpg' {
|
||||
const content: any
|
||||
export default content
|
||||
}
|
||||
|
||||
declare module '*.otf' {
|
||||
const content: any
|
||||
export default content
|
||||
@@ -9,8 +9,6 @@ import { History } from 'history'
|
||||
import Topbar from './components/TopBar'
|
||||
import Routes from './routes'
|
||||
|
||||
import '../public/favicon.ico'
|
||||
|
||||
import LandingBG from '../images/landing-bg.svg'
|
||||
import './styles.scss'
|
||||
|
||||
@@ -22,6 +20,7 @@ interface MainProps {
|
||||
}
|
||||
|
||||
const Index: React.FC<MainProps> = ({ store, history }) => {
|
||||
|
||||
return (
|
||||
<Provider store={store}>
|
||||
<ConnectedRouter history={history}>
|
||||
@@ -0,0 +1,253 @@
|
||||
import * as React from 'react'
|
||||
|
||||
import './styles.scss'
|
||||
|
||||
interface AppsWebPartProps {}
|
||||
|
||||
interface AppsWebPartState {
|
||||
appsUnfiltered: Array<any>
|
||||
// appsFiltered: Array<any>;
|
||||
showChapters: boolean
|
||||
showFunding: boolean
|
||||
showTranscript: boolean
|
||||
showAll: boolean
|
||||
activeFilter: string[]
|
||||
filterList: Array<{ id: number; name: string; value: string }>
|
||||
}
|
||||
|
||||
export default class AppsWebPart extends React.Component<
|
||||
AppsWebPartProps,
|
||||
AppsWebPartState
|
||||
> {
|
||||
constructor(props: AppsWebPartProps) {
|
||||
super(props)
|
||||
this.state = {
|
||||
appsUnfiltered: [],
|
||||
// appsFiltered: [],
|
||||
showChapters: false,
|
||||
showFunding: false,
|
||||
showTranscript: false,
|
||||
activeFilter: [],
|
||||
showAll: false,
|
||||
filterList: [
|
||||
{
|
||||
id: 33,
|
||||
name: 'Transcript',
|
||||
value: 'Transcript',
|
||||
},
|
||||
{
|
||||
id: 34,
|
||||
name: 'Locked',
|
||||
value: 'Locked',
|
||||
},
|
||||
{
|
||||
id: 35,
|
||||
name: 'Funding',
|
||||
value: 'Funding',
|
||||
},
|
||||
{
|
||||
id: 36,
|
||||
name: 'Chapters',
|
||||
value: 'Chapters',
|
||||
},
|
||||
{
|
||||
id: 37,
|
||||
name: 'Soundbite',
|
||||
value: 'Soundbite',
|
||||
},
|
||||
{
|
||||
id: 38,
|
||||
name: 'Person',
|
||||
value: 'Person',
|
||||
},
|
||||
],
|
||||
}
|
||||
}
|
||||
|
||||
_isMounted = false
|
||||
|
||||
async componentDidMount() {
|
||||
this._isMounted = true
|
||||
//console.log("componentDidMount(): loading from JSON:")
|
||||
const appsUnfiltered = await this.getApps()
|
||||
const appsFiltered = [...appsUnfiltered]
|
||||
console.log('fetched apps from JSON : ', appsUnfiltered)
|
||||
if (this._isMounted) {
|
||||
this.setState({
|
||||
appsUnfiltered, //, appsFiltered
|
||||
})
|
||||
}
|
||||
}
|
||||
|
||||
componentWillUnmount() {
|
||||
this._isMounted = false
|
||||
}
|
||||
|
||||
async getApps() {
|
||||
let response = await fetch(`/api/apps`, {
|
||||
credentials: 'same-origin',
|
||||
method: 'GET',
|
||||
})
|
||||
return await response.json()
|
||||
}
|
||||
|
||||
onFilterChange(filter) {
|
||||
const { filterList, activeFilter } = this.state
|
||||
if (filter === 'ALL') {
|
||||
if (activeFilter.length === filterList.length) {
|
||||
this.setState({ activeFilter: [] })
|
||||
} else {
|
||||
this.setState({
|
||||
activeFilter: filterList.map((filter) => filter.value),
|
||||
})
|
||||
}
|
||||
} else {
|
||||
if (activeFilter.includes(filter)) {
|
||||
const filterIndex = activeFilter.indexOf(filter)
|
||||
const newFilter = [...activeFilter]
|
||||
newFilter.splice(filterIndex, 1)
|
||||
this.setState({ activeFilter: newFilter })
|
||||
} else {
|
||||
this.setState({ activeFilter: [...activeFilter, filter] })
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
renderCheckboxes() {
|
||||
return (
|
||||
<div className="podcastIndexAppsCheckboxArea">
|
||||
Show:
|
||||
<label>
|
||||
<input
|
||||
onChange={() => this.onFilterChange('ALL')}
|
||||
type="checkbox"
|
||||
name="showAll"
|
||||
checked={
|
||||
this.state.activeFilter.length ===
|
||||
this.state.filterList.length
|
||||
}
|
||||
className="podcastIndexAppsCheckbox"
|
||||
></input>
|
||||
All
|
||||
</label>
|
||||
{this.state.filterList.map((filter) => (
|
||||
<span key={`checkboxArea${filter.id}`}>
|
||||
<label>
|
||||
<input
|
||||
onChange={() =>
|
||||
this.onFilterChange(filter.value)
|
||||
}
|
||||
type="checkbox"
|
||||
name={filter.name}
|
||||
checked={this.state.activeFilter.includes(
|
||||
filter.value
|
||||
)}
|
||||
className="podcastIndexAppsCheckbox"
|
||||
></input>
|
||||
{filter.name}
|
||||
</label>
|
||||
</span>
|
||||
))}
|
||||
</div>
|
||||
)
|
||||
}
|
||||
|
||||
matchFound(anApp) {
|
||||
const { activeFilter } = this.state
|
||||
//console.log("activeFilter=",activeFilter);
|
||||
let matchFound: boolean = false
|
||||
anApp.supportedElements.forEach(function (anElement) {
|
||||
//console.log("anElement.elementName=["+anElement.elementName+"]")
|
||||
if (activeFilter.includes(anElement.elementName)) {
|
||||
//console.log("bingo!");
|
||||
matchFound = true
|
||||
}
|
||||
})
|
||||
return matchFound
|
||||
}
|
||||
|
||||
render() {
|
||||
const { filterList, activeFilter } = this.state
|
||||
//console.log("activeFilter=",activeFilter);
|
||||
let appsFiltered: Array<any>
|
||||
if (
|
||||
activeFilter.length === 0 ||
|
||||
activeFilter.length === filterList.length
|
||||
) {
|
||||
//filteredList = this.state.searchLists;
|
||||
appsFiltered = [...this.state.appsUnfiltered]
|
||||
} else {
|
||||
appsFiltered = this.state.appsUnfiltered.filter((anApp) =>
|
||||
this.matchFound(anApp)
|
||||
)
|
||||
}
|
||||
let appsFilteredAndSorted: Array<any> = appsFiltered.sort((a1, a2) => {
|
||||
return a1.appName.localeCompare(a2.appName)
|
||||
})
|
||||
return (
|
||||
<div className="podcastIndexAppsWebPart">
|
||||
<h4>Applications Using the "Podcast" Namespace</h4>
|
||||
For elements that are included in the official{' '}
|
||||
<a href="https://github.com/Podcastindex-org/podcast-namespace/blob/main/docs/1.0.md">
|
||||
XMLNS document
|
||||
</a>
|
||||
, we will highlight applications offering production support.
|
||||
Links should point to a public announcement or production
|
||||
example. The "Search" property listed below just means that the
|
||||
platform integrates with the Podcast Index directory search
|
||||
function.
|
||||
<h4>Elements</h4>
|
||||
{this.renderCheckboxes()}
|
||||
<div className="podcastIndexApps">
|
||||
<div className="podcastIndexAppsHeader" />
|
||||
<h4 className="podcastIndexAppsHeader">App</h4>
|
||||
<h4 className="podcastIndexAppsHeader">
|
||||
Supported Elements
|
||||
</h4>
|
||||
<h4 className="podcastIndexAppsHeader">Platforms</h4>
|
||||
{appsFilteredAndSorted.map((app, i) => (
|
||||
<React.Fragment key={`${i}`}>
|
||||
<div className="podcastIndexAppIcon">
|
||||
<img
|
||||
src={`${document.location.origin}/api/images/${app.appIconUrl}`}
|
||||
></img>
|
||||
</div>
|
||||
|
||||
<div className="podcastIndexAppTitleAndType">
|
||||
<a
|
||||
className="podcastIndexAppTitle"
|
||||
href={app.appUrl}
|
||||
>
|
||||
{app.appName}
|
||||
</a>
|
||||
<p className="podcastIndexAppType">
|
||||
{app.appType}
|
||||
</p>
|
||||
</div>
|
||||
|
||||
<div className="podcastIndexAppSupportedElements">
|
||||
{app.supportedElements.map((suppElement, j) => (
|
||||
<React.Fragment key={`${j}`}>
|
||||
{j > 0 && ', '}
|
||||
<a href={suppElement.elementURL}>
|
||||
{suppElement.elementName}
|
||||
</a>
|
||||
</React.Fragment>
|
||||
))}
|
||||
</div>
|
||||
|
||||
<div className="podcastIndexAppPlatforms">
|
||||
{app.platforms.map((platform, j) => (
|
||||
<React.Fragment key={`${j}`}>
|
||||
{j > 0 && ', '}
|
||||
{platform}
|
||||
</React.Fragment>
|
||||
))}
|
||||
</div>
|
||||
</React.Fragment>
|
||||
))}
|
||||
</div>
|
||||
</div>
|
||||
)
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,118 @@
|
||||
.podcastIndexAppsWebPart {
|
||||
/*background-color: #e0e0e0;*/
|
||||
border-radius: 8px;
|
||||
}
|
||||
|
||||
.podcastIndexAppsCheckboxArea {
|
||||
background-color: #dcdcdc;
|
||||
border-radius: 5px;
|
||||
padding: 4px;
|
||||
margin-bottom: 8px;
|
||||
}
|
||||
|
||||
.podcastIndexAppsWebPart > h4 {
|
||||
font-size: 20px;
|
||||
|
||||
margin-top: 3px;
|
||||
margin-bottom: 3px;
|
||||
padding-top: 20px;
|
||||
padding-bottom: 10px;
|
||||
}
|
||||
|
||||
.podcastIndexAppsCheckboxArea label {
|
||||
display: inline-block;
|
||||
margin-left: 8px;
|
||||
padding-left: 10px;
|
||||
padding-right: 3px;
|
||||
}
|
||||
|
||||
.podcastIndexAppsCheckboxArea label input[type='checkbox'] {
|
||||
margin-left: -8px;
|
||||
}
|
||||
|
||||
.podcastIndexApps {
|
||||
display: grid;
|
||||
gap: 16px 32px;
|
||||
grid-template-columns:
|
||||
[image-start] 60px
|
||||
[image-end name-start] 1fr
|
||||
[name-end elements-start] 1fr
|
||||
[elements-end platforms-start] 192px
|
||||
[platforms-end];
|
||||
grid-template-rows: 30px;
|
||||
|
||||
margin-top: 24px;
|
||||
|
||||
a:link,
|
||||
a:visited,
|
||||
a:active {
|
||||
display: inline-block;
|
||||
color: #002752;
|
||||
}
|
||||
|
||||
a:hover {
|
||||
color: #cc2799;
|
||||
}
|
||||
}
|
||||
|
||||
.podcastIndexAppsHeader {
|
||||
align-self: end;
|
||||
|
||||
font-size: 16px;
|
||||
font-weight: 700;
|
||||
margin: 0;
|
||||
}
|
||||
|
||||
.podcastIndexAppIcon {
|
||||
align-self: center;
|
||||
|
||||
img {
|
||||
width: 60px;
|
||||
height: 60px;
|
||||
|
||||
border-radius: 5px;
|
||||
}
|
||||
}
|
||||
|
||||
.podcastIndexAppTitleAndType {
|
||||
align-self: center;
|
||||
|
||||
.podcastIndexAppTitle {
|
||||
font-size: 24px;
|
||||
}
|
||||
.podcastIndexAppType {
|
||||
color: #4b4b58;
|
||||
margin: 0;
|
||||
}
|
||||
}
|
||||
|
||||
.podcastIndexAppSupportedElements {
|
||||
align-self: center;
|
||||
line-height: 1.5;
|
||||
}
|
||||
|
||||
.podcastIndexAppPlatforms {
|
||||
align-self: center;
|
||||
|
||||
color: #333333;
|
||||
line-height: 1.5;
|
||||
}
|
||||
|
||||
@media only screen and (max-width: 767px) {
|
||||
.podcastIndexApps {
|
||||
display: grid;
|
||||
column-gap: 48px;
|
||||
grid-template-columns:
|
||||
[image-start] 60px
|
||||
[image-end name-start] 1fr
|
||||
[name-end];
|
||||
grid-template-rows: none;
|
||||
|
||||
margin-top: 24px;
|
||||
}
|
||||
.podcastIndexAppsHeader,
|
||||
.podcastIndexAppSupportedElements,
|
||||
.podcastIndexAppPlatforms {
|
||||
display: none;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,24 @@
|
||||
import * as React from 'react'
|
||||
|
||||
import AppsWebPart from './AppsWebPart'
|
||||
|
||||
import './styles.scss'
|
||||
|
||||
interface IProps {}
|
||||
|
||||
export default class Apps extends React.Component<IProps> {
|
||||
static defaultProps = {}
|
||||
|
||||
constructor(props: IProps) {
|
||||
super(props)
|
||||
}
|
||||
|
||||
render() {
|
||||
const {} = this.props
|
||||
return (
|
||||
<div className="landing-content" style={{ marginTop: 20 }}>
|
||||
<AppsWebPart/>
|
||||
</div>
|
||||
)
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,5 @@
|
||||
.csb {
|
||||
background-color: darkolivegreen;
|
||||
color: yellow;
|
||||
font-size: 12px;
|
||||
}
|
||||
@@ -0,0 +1,18 @@
|
||||
import * as React from 'react'
|
||||
|
||||
export default class DonationThankYou extends React.PureComponent {
|
||||
render() {
|
||||
return (
|
||||
<div className="page-content">
|
||||
<h1>Thank you!</h1>
|
||||
<p>
|
||||
It's people like you that help keeps podcasting as a
|
||||
platform for free speech possible.
|
||||
</p>
|
||||
<p>
|
||||
<a href="/">Back to the home page</a>
|
||||
</p>
|
||||
</div>
|
||||
)
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,252 @@
|
||||
import * as React from 'react'
|
||||
import ReactList from 'react-list'
|
||||
import ReactLoading from 'react-loading'
|
||||
import PodcastHeader from '../../../components/PodcastHeader'
|
||||
import Player from '../../../components/Player'
|
||||
import EpisodeItem from '../../../components/EpisodeItem'
|
||||
import { updateTitle } from '../../../utils'
|
||||
|
||||
import './styles.scss'
|
||||
|
||||
interface IProps {
|
||||
match: any
|
||||
result?: Object
|
||||
}
|
||||
|
||||
export default class PodcastInfo extends React.PureComponent<IProps> {
|
||||
state = {
|
||||
result: Object(),
|
||||
episodes: [],
|
||||
loading: true,
|
||||
selectedEpisode: undefined,
|
||||
playing: false,
|
||||
}
|
||||
_isMounted = false
|
||||
player = React.createRef<Player>()
|
||||
episodeItems: any[] = []
|
||||
|
||||
constructor(props) {
|
||||
super(props)
|
||||
// fix this in handlers
|
||||
this.onEpisodePlay = this.onEpisodePlay.bind(this)
|
||||
this.onEpisodePause = this.onEpisodePause.bind(this)
|
||||
this.onEpisodeCanPlay = this.onEpisodeCanPlay.bind(this)
|
||||
}
|
||||
|
||||
async componentDidMount(): Promise<void> {
|
||||
this._isMounted = true
|
||||
|
||||
let id = this.props.match.params.podcastId
|
||||
if (id) {
|
||||
const result = (await this.getPodcastInfo(id)).feed
|
||||
const episodes = (await this.getEpisodes(id)).items
|
||||
if (this._isMounted) {
|
||||
this.setState({
|
||||
loading: false,
|
||||
result,
|
||||
episodes,
|
||||
selectedEpisode: episodes[0],
|
||||
})
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
componentWillUnmount() {
|
||||
this._isMounted = false
|
||||
}
|
||||
|
||||
async componentDidUpdate(prevProps) {
|
||||
let id = this.props.match.params.podcastId
|
||||
if (id !== prevProps.match.params.podcastId) {
|
||||
this.setState({
|
||||
loading: true,
|
||||
})
|
||||
const result = (await this.getPodcastInfo(id)).feed
|
||||
const episodes = (await this.getEpisodes(id)).items
|
||||
this.setState({
|
||||
loading: false,
|
||||
result,
|
||||
episodes,
|
||||
selectedEpisode: episodes[0],
|
||||
})
|
||||
}
|
||||
}
|
||||
|
||||
async getPodcastInfo(id: string) {
|
||||
let response = await fetch(`/api/podcasts/byfeedid?id=${id}`, {
|
||||
// credentials: 'same-origin',
|
||||
method: 'GET',
|
||||
})
|
||||
return await response.json()
|
||||
}
|
||||
|
||||
async getEpisodes(id: string) {
|
||||
let response = await fetch(`/api/episodes/byfeedid?id=${id}`, {
|
||||
// credentials: 'same-origin',
|
||||
method: 'GET',
|
||||
})
|
||||
return await response.json()
|
||||
}
|
||||
|
||||
onEpisodePlay(index: number) {
|
||||
this.setState({
|
||||
playing: true,
|
||||
})
|
||||
|
||||
if (index === undefined) {
|
||||
index = this.state.episodes.findIndex(
|
||||
(x) => x === this.state.selectedEpisode
|
||||
)
|
||||
}
|
||||
const episode = this.state.episodes[index]
|
||||
|
||||
if (this.state.selectedEpisode !== episode) {
|
||||
this.setState({
|
||||
selectedEpisode: episode,
|
||||
})
|
||||
}
|
||||
|
||||
// FIXME: this doesn't trigger if episode was changed. Workaround, for now, is to set the playing state here
|
||||
// and then check it when onCanPlay is triggered (handled by onEpisodeCanPlay) where the play call can be
|
||||
// made again.
|
||||
this.player.current.play()
|
||||
|
||||
// set all but current episode button to play; current to pause
|
||||
this.episodeItems.forEach((episodeItem) => {
|
||||
episodeItem.current.setPlaying(
|
||||
index === episodeItem.current.props.index
|
||||
)
|
||||
})
|
||||
}
|
||||
|
||||
onEpisodePause() {
|
||||
this.setState({
|
||||
playing: false,
|
||||
})
|
||||
|
||||
this.player.current.pause()
|
||||
|
||||
// set episode buttons to play
|
||||
this.episodeItems.forEach((episodeItem) => {
|
||||
episodeItem.current.setPlaying(false)
|
||||
})
|
||||
}
|
||||
|
||||
onEpisodeCanPlay() {
|
||||
if (this.state.playing) {
|
||||
this.player.current.play()
|
||||
}
|
||||
}
|
||||
|
||||
renderHeader() {
|
||||
let title = this.state.result.title
|
||||
let image = this.state.result.image || this.state.result.artwork
|
||||
let author = this.state.result.author
|
||||
let description = this.state.result.description
|
||||
let categories = this.state.result.categories
|
||||
let id = this.state.result.id
|
||||
let podcastURL = this.state.result.link
|
||||
let feedURL = this.state.result.url
|
||||
|
||||
updateTitle(title)
|
||||
return (
|
||||
<PodcastHeader
|
||||
title={title}
|
||||
author={author}
|
||||
image={image}
|
||||
description={description}
|
||||
categories={categories}
|
||||
id={id}
|
||||
podcastURL={podcastURL}
|
||||
feedURL={feedURL}
|
||||
/>
|
||||
)
|
||||
}
|
||||
|
||||
renderPlayer() {
|
||||
return (
|
||||
<div className="podcast-header-player">
|
||||
<Player
|
||||
ref={this.player}
|
||||
episode={this.state.selectedEpisode}
|
||||
onPlay={this.onEpisodePlay}
|
||||
onPause={this.onEpisodePause}
|
||||
onCanPlay={this.onEpisodeCanPlay}
|
||||
/>
|
||||
</div>
|
||||
)
|
||||
}
|
||||
|
||||
renderEpisodes() {
|
||||
return (
|
||||
<div className="episodes-list">
|
||||
<h2 className="episode-header">Episodes</h2>
|
||||
<ReactList
|
||||
minSize={10}
|
||||
pageSize={10}
|
||||
itemRenderer={this.renderEpisode.bind(this)}
|
||||
length={this.state.episodes.length}
|
||||
type="simple"
|
||||
/>
|
||||
</div>
|
||||
)
|
||||
}
|
||||
|
||||
renderEpisode(index: number, key: number) {
|
||||
let title = this.state.episodes[index].title
|
||||
// try to use episode image, fall back to feed images
|
||||
let image =
|
||||
this.state.episodes[index].image ||
|
||||
this.state.episodes[index].feedImage ||
|
||||
this.state.result.image ||
|
||||
this.state.result.artwork
|
||||
let link = this.state.episodes[index].link
|
||||
let description = this.state.episodes[index].description
|
||||
let datePublished = this.state.episodes[index].datePublished
|
||||
|
||||
// create a reference to the generated EpisodeItem if one doesn't already exist
|
||||
if (index >= this.episodeItems.length) {
|
||||
this.episodeItems.push(React.createRef<EpisodeItem>())
|
||||
}
|
||||
|
||||
return (
|
||||
<div key={key}>
|
||||
<EpisodeItem
|
||||
ref={this.episodeItems[index]}
|
||||
index={index}
|
||||
title={title}
|
||||
image={image}
|
||||
link={link}
|
||||
description={description}
|
||||
datePublished={datePublished}
|
||||
onPlay={this.onEpisodePlay}
|
||||
onPause={this.onEpisodePause}
|
||||
/>
|
||||
</div>
|
||||
)
|
||||
}
|
||||
|
||||
render() {
|
||||
const { loading, result, episodes } = this.state
|
||||
if ((result === undefined || episodes.length === 0) && !loading) {
|
||||
const errorMessage = `Unknown podcast ID: ${this.props.match.params.podcastId}`
|
||||
updateTitle(errorMessage)
|
||||
return <div className="page-content">{errorMessage}</div>
|
||||
}
|
||||
if (loading) {
|
||||
updateTitle('Loading podcast ...')
|
||||
return (
|
||||
<div className="loader-wrapper" style={{ height: 300 }}>
|
||||
<ReactLoading type="cylon" color="#e90000" />
|
||||
</div>
|
||||
)
|
||||
}
|
||||
return (
|
||||
<div className="page-content">
|
||||
{this.renderHeader()}
|
||||
{this.renderPlayer()}
|
||||
{this.renderEpisodes()}
|
||||
</div>
|
||||
)
|
||||
}
|
||||
}
|
||||