-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat(pwa): enable basic pwa for app,
act as share target
- Loading branch information
Showing
28 changed files
with
1,125 additions
and
64 deletions.
There are no files selected for viewing
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,18 +1,23 @@ | ||
/* eslint-disable @typescript-eslint/no-var-requires */ | ||
'use strict'; | ||
|
||
require('./env.js'); | ||
// eslint-disable-next-line @typescript-eslint/no-var-requires | ||
const consola = require('consola'); | ||
consola.withTag('app'); | ||
consola.wrapConsole(); | ||
const withPlugins = require('next-compose-plugins'); | ||
const withTM = require('next-transpile-modules')(['design-system']); | ||
module.exports = withTM({ | ||
distDir: process.env.NODE_ENV === 'development' ? '.next' : '../../../../dist/app/functions/next', | ||
const withPWA = require('next-pwa'); | ||
const distDir = process.env.NODE_ENV === 'development' ? '.next' : '../../../../dist/app/functions/next'; | ||
const nextConfiguration = { | ||
distDir, | ||
// Public, build-time env vars. | ||
// https://nextjs.org/docs#build-time-configuration | ||
env: { | ||
FIREBASE_AUTH_DOMAIN: process.env.FIREBASE_AUTH_DOMAIN, | ||
FIREBASE_PROJECT_ID: process.env.FIREBASE_PROJECT_ID, | ||
FIREBASE_PUBLIC_API_KEY: process.env.FIREBASE_PUBLIC_API_KEY, | ||
}, | ||
}); | ||
}; | ||
module.exports = withPlugins([withTM, [withPWA, { dest: 'public' }]], nextConfiguration); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,34 @@ | ||
import { NextApiRequest, NextApiResponse } from 'next'; | ||
import formidable from 'formidable'; | ||
import { auth } from 'firebase-admin'; | ||
import admin, { firestore } from '../../../functions/initFirebase'; | ||
import commonMiddleware from '../../utils/middleware/commonMiddleware'; | ||
|
||
const handler = async ( | ||
req: NextApiRequest & { session?: { decodedToken: auth.DecodedIdToken; token: string } }, | ||
res: NextApiResponse | ||
): Promise<void> => { | ||
const form = formidable(); | ||
await form.parse(req, async (err, fields) => { | ||
if (err) { | ||
return; | ||
} | ||
const urlData = { | ||
...fields, | ||
created: admin.firestore.FieldValue.serverTimestamp(), | ||
status: 'new', | ||
processed: {}, | ||
}; | ||
// Push the new url into Cloud Firestore using the Firebase Admin SDK. | ||
console.info(urlData, req.session); | ||
return await firestore.collection('pages').add(urlData); | ||
}); | ||
|
||
res.end(); | ||
}; | ||
export const config = { | ||
api: { | ||
bodyParser: false, | ||
}, | ||
}; | ||
export default commonMiddleware(handler); |
Binary file not shown.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
5 changes: 5 additions & 0 deletions
5
packages/poolbase-app/src/app/public/images/icons/poolbase-icon.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,61 @@ | ||
{ | ||
"name": "poolbase", | ||
"short_name": "poolbase", | ||
"theme_color": "#1887ED", | ||
"background_color": "#2d3748", | ||
"display": "browser", | ||
"orientation": "portrait", | ||
"Scope": "/", | ||
"start_url": "/", | ||
"share_target": { | ||
"action": "/add-url", | ||
"method": "GET", | ||
"params": { | ||
"title": "title", | ||
"url": "url" | ||
} | ||
}, | ||
"icons": [ | ||
{ | ||
"src": "images/icons/ico72.png", | ||
"sizes": "72x72", | ||
"type": "image/png" | ||
}, | ||
{ | ||
"src": "images/icons/ico96.png", | ||
"sizes": "96x96", | ||
"type": "image/png" | ||
}, | ||
{ | ||
"src": "images/icons/icon128.png", | ||
"sizes": "128x128", | ||
"type": "image/png" | ||
}, | ||
{ | ||
"src": "images/icons/icon144.png", | ||
"sizes": "144x144", | ||
"type": "image/png" | ||
}, | ||
{ | ||
"src": "images/icons/icon152.png", | ||
"sizes": "152x152", | ||
"type": "image/png" | ||
}, | ||
{ | ||
"src": "images/icons/icon192.png", | ||
"sizes": "192x192", | ||
"type": "image/png" | ||
}, | ||
{ | ||
"src": "images/icons/icon384.png", | ||
"sizes": "384x384", | ||
"type": "image/png" | ||
}, | ||
{ | ||
"src": "images/icons/icon512.png", | ||
"sizes": "512x512", | ||
"type": "image/png" | ||
} | ||
], | ||
"splash_pages": null | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.