Skip to content

Commit

Permalink
Profile dropdown links handler
Browse files Browse the repository at this point in the history
  • Loading branch information
DmitriVanGuard committed May 11, 2022
1 parent f425ebc commit 07183ed
Show file tree
Hide file tree
Showing 5 changed files with 26 additions and 21 deletions.
22 changes: 11 additions & 11 deletions package-lock.json

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

6 changes: 3 additions & 3 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -28,15 +28,15 @@
"mobile-detect": "^1.4.5",
"node-fetch": "^2.6.1",
"polka": "next",
"san-webkit": "https://github.com/santiment/san-webkit#dc162c6",
"san-webkit": "https://github.com/santiment/san-webkit#4ab06fa",
"sirv": "^1.0.0",
"turndown": "^7.1.1",
"medium-editor": "^5.23.3",
"marked": "^4.0.12"
},
"devDependencies": {
"@babel/plugin-proposal-optional-chaining": "^7.16.7",
"@babel/core": "^7.17.9",
"@babel/plugin-proposal-optional-chaining": "^7.16.7",
"babel-eslint": "^10.1.0",
"copy-webpack-plugin": "5.1.2",
"css-loader": "^5.1.4",
Expand All @@ -58,7 +58,7 @@
"sass": "^1.49.7",
"sass-loader": "^12.2.0",
"style-loader": "^2.0.0",
"svelte": "^3.46.3",
"svelte": "^3.48.0",
"svelte-loader": "^3.1.2",
"svelte-preprocess": "^4.6.9",
"svelte-preprocess-cssmodules": "https://github.com/DmitriVanGuard/svelte-preprocess-cssmodules#0fe6fa7",
Expand Down
11 changes: 10 additions & 1 deletion src/client.js
Original file line number Diff line number Diff line change
Expand Up @@ -15,13 +15,22 @@ if (process.env.IS_PROD_MODE) {
initGA('UA-100571693-11')
}

const APP_LINK = 'https://insights.santiment.net'
window.__onLinkClick = (e) => {
const node = e.currentTarget
if (!node) return

const href = node.getAttribute('href')
if (!href) return

e.preventDefault()

if (href.startsWith('/profile/')) {
e.preventDefault()
window.location.href = 'https://app.santiment.net' + href
} else if (href.startsWith(APP_LINK) || href.startsWith('/')) {
sapper.goto(href.replace(APP_LINK, ''))
} else {
window.location.href = href
}
}

Expand Down
2 changes: 1 addition & 1 deletion src/components/TagFilters.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
const { page } = stores()
const TAGS = [
['/', 'All'],
['', 'All'],
['defi', 'DeFi'],
['btc', 'BTC'],
['eth,erc-20', 'ETH + ERC-20'],
Expand Down
6 changes: 1 addition & 5 deletions src/routes/read/_SuggestedInsights.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@
<h3 class="body-1 mrg-xl mrg--b">Suggested insights</h3>

<div class="visible">
<div class="scroll row">
<div class="scroll row no-scrollbar">
{#each insights as insight}
<InsightCard {insight} isWithPrice={false} class="$style.item mrg-xl mrg--r" />
{/each}
Expand Down Expand Up @@ -71,10 +71,6 @@
height: calc(100% + 10px);
width: 1143px;
-ms-overflow-style: none;
scrollbar-width: none;
}
.scroll::-webkit-scrollbar {
display: none;
}
:global(body:not(.desktop) .scroll) {
Expand Down

0 comments on commit 07183ed

Please sign in to comment.