adapt domain, add base path, test "relatedProjects"
This commit is contained in:
+2
-1
@@ -11,5 +11,6 @@
|
||||
"source": "/frontend/:match*",
|
||||
"destination": "https://monorepo-test-frontend-neon.vercel.app/:match*"
|
||||
}
|
||||
]
|
||||
],
|
||||
"relatedProjects": ["prj_emQEOHSrnlodZCgZ1kyzVsiiGSQm"]
|
||||
}
|
||||
@@ -9,12 +9,16 @@ export const CLIENT_ID = PROD
|
||||
|
||||
export const MODE = process.env.REACT_APP_MODE;
|
||||
|
||||
export const HOST = PROD
|
||||
? 'monorepo-test-backend-seven.vercel.app'
|
||||
: 'localhost:3000';
|
||||
|
||||
export const REDIRECT_URI = PROD
|
||||
? MODE === 'trends'
|
||||
? 'https://www.githubtrends.io/user'
|
||||
? `https://${HOST}/frontend/user`
|
||||
: 'https://www.githubtrends.io/user/wrapped'
|
||||
: MODE === 'trends'
|
||||
? 'http://localhost:3000/user'
|
||||
? `http://${HOST}/frontend/user`
|
||||
: 'http://localhost:3000/user/wrapped';
|
||||
|
||||
export const GITHUB_PRIVATE_AUTH_URL = `https://github.com/login/oauth/authorize?scope=user,repo&client_id=${CLIENT_ID}&redirect_uri=${REDIRECT_URI}/private`;
|
||||
|
||||
@@ -76,7 +76,7 @@ function App() {
|
||||
|
||||
return (
|
||||
<div className="h-screen flex flex-col">
|
||||
<Router>
|
||||
<Router basename="/frontend">
|
||||
<Header mode="trends" />
|
||||
<section className="bg-white text-gray-700 flex-grow">
|
||||
<Routes>
|
||||
|
||||
@@ -13,10 +13,12 @@ import {
|
||||
|
||||
import { authenticate } from '../../api';
|
||||
import { login as _login } from '../../redux/actions/userActions';
|
||||
import { PROD } from '../../constants';
|
||||
import { HOST } from '../../constants';
|
||||
import { CardTypes } from '../../utils';
|
||||
|
||||
const HomeScreen = () => {
|
||||
console.log('new env var:', process.env.VERCEL_RELATED_PROJECTS);
|
||||
|
||||
const [isLoading, setIsLoading] = useState(false);
|
||||
|
||||
const userId = useSelector((state) => state.user.userId);
|
||||
@@ -118,8 +120,7 @@ const HomeScreen = () => {
|
||||
if (url.includes('code=')) {
|
||||
const tempPrivateAccess = url.includes('private');
|
||||
const newUrl = url.split('?code=');
|
||||
const subStr = PROD ? 'githubtrends.io' : 'localhost:3000';
|
||||
const redirect = `${url.split(subStr)[0]}${subStr}/user`;
|
||||
const redirect = `${url.split(HOST)[0]}${HOST}/frontend/user`;
|
||||
window.history.pushState({}, null, redirect);
|
||||
setIsLoading(true);
|
||||
const userKey = uuidv4();
|
||||
|
||||
@@ -1,5 +1,6 @@
|
||||
{
|
||||
"buildCommand": "yarn build-trends",
|
||||
"outputDirectory": "build",
|
||||
"installCommand": "yarn install"
|
||||
"installCommand": "yarn install",
|
||||
"relatedProjects": ["prj_ubTjOvYDA9zS24cT9hMARICRm9Vm"]
|
||||
}
|
||||
Reference in New Issue
Block a user