Skip to content

Commit

Permalink
Use older node-sass version, as node on build is not compatible; add …
Browse files Browse the repository at this point in the history
…logging in App component
  • Loading branch information
Elektropepi committed Jan 21, 2021
1 parent 37ca0f9 commit e40abe6
Show file tree
Hide file tree
Showing 5 changed files with 151 additions and 33 deletions.
170 changes: 140 additions & 30 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
"@types/react": "^17.0.0",
"@types/react-dom": "^17.0.0",
"content-disposition": "^0.5.3",
"node-sass": "^5.0.0",
"node-sass": "^4.14.1",
"react": "^17.0.1",
"react-dom": "^17.0.1",
"react-scripts": "4.0.1",
Expand Down
7 changes: 7 additions & 0 deletions src/App.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,13 @@ interface State {
}

export default function App() {
// @ts-ignore
const parsedUrl = new URL(window.location);
console.log('within App - window.location.href' + window.location.href);
console.log('within App - title shared: ' + parsedUrl.searchParams.get('title'));
console.log('within App - text shared: ' + parsedUrl.searchParams.get('text'));
console.log('within App - URL shared: ' + parsedUrl.searchParams.get('url'));

const [state, setState] = useState<State>({
url: "",
downloadedFile: null,
Expand Down
3 changes: 2 additions & 1 deletion src/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -45,11 +45,12 @@ window.addEventListener('load', () => {
console.log('Text shared: ' + parsedUrl.searchParams.get('description'));
console.log('Link shared: ' + parsedUrl.searchParams.get('link'));
console.log('URL shared: ' + parsedUrl.searchParams.get('url'));
/*
if(parsedUrl.searchParams.get('link') !== null) {
const share = new Share();
share.share(parsedUrl.searchParams.get('link'));
} else if(parsedUrl.searchParams.get('url') !== null) {
const share = new Share();
share.share(parsedUrl.searchParams.get('url'));
}
}*/
});
2 changes: 1 addition & 1 deletion tsconfig.json
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
"resolveJsonModule": true,
"isolatedModules": true,
"noEmit": true,
"jsx": "react",
"jsx": "react-jsx",
"noFallthroughCasesInSwitch": true,
"removeComments": true,
"sourceMap": true
Expand Down

0 comments on commit e40abe6

Please sign in to comment.