-
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.
* unify getDomainNameAndTldFromUrl in shared * make popup init faster Former-commit-id: 2808cfdccfd51a3f1c170ddaa805092c809b1555 [formerly 6f5f920] Former-commit-id: 6c5619d
- Loading branch information
Showing
16 changed files
with
64 additions
and
63 deletions.
There are no files selected for viewing
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,11 @@ | ||
/** | ||
* Extracts the domain name and TLD from a URL | ||
* | ||
* @param url - The URL to extract the domain name and TLD from | ||
* @returns The domain name and TLD from the URL | ||
*/ | ||
export const getDomainNameAndTldFromUrl = (url: string) => { | ||
const host = new URL(url ?? '').hostname | ||
const parts = host.split('.') | ||
return `${parts[parts.length - 2]}.${parts[parts.length - 1]}` | ||
} |
This file was deleted.
Oops, something went wrong.
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
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 |
---|---|---|
|
@@ -3,23 +3,27 @@ import * as Sentry from '@sentry/browser' | |
import ReactDOM from 'react-dom/client' | ||
import browser from 'webextension-polyfill' | ||
import { ApolloProvider } from '@apollo/client' | ||
import App from './App' | ||
import { apolloClient } from './apollo/apolloClient' | ||
import { ColorModeScript } from '@chakra-ui/react' | ||
import { chakraRawTheme } from '@shared/chakraRawTheme' | ||
import { ExtensionProviders } from './ExtensionProviders' | ||
import PopupRoutes from './PopupRoutes' | ||
|
||
Sentry.init({ | ||
dsn: 'https://[email protected]/5955889' | ||
}) | ||
|
||
let popupRoot | ||
export const renderPopup = () => { | ||
console.log('renderPopup') | ||
popupRoot.render( | ||
<ApolloProvider client={apolloClient}> | ||
<ColorModeScript | ||
initialColorMode={chakraRawTheme.config?.initialColorMode} | ||
/> | ||
<App parent="popup" /> | ||
<ExtensionProviders> | ||
<PopupRoutes /> | ||
</ExtensionProviders> | ||
</ApolloProvider> | ||
) | ||
} | ||
|
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
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 |
---|---|---|
|
@@ -5,11 +5,13 @@ import ReactDOM from 'react-dom/client' | |
|
||
import browser from 'webextension-polyfill' | ||
import { ApolloProvider } from '@apollo/client' | ||
import App from './App' | ||
|
||
import { apolloClient } from './apollo/apolloClient' | ||
import { HashRouter } from 'react-router-dom' | ||
import { ColorModeScript } from '@chakra-ui/react' | ||
import { chakraRawTheme } from '../../shared/chakraRawTheme' | ||
import { ExtensionProviders } from './ExtensionProviders' | ||
import { VaultRouter } from './pages-vault/VaultRouter' | ||
|
||
Sentry.init({ | ||
dsn: 'https://[email protected]/5955889' | ||
|
@@ -23,7 +25,9 @@ export const renderVault = () => { | |
<ColorModeScript | ||
initialColorMode={chakraRawTheme.config?.initialColorMode} | ||
/> | ||
<App parent="vault" /> | ||
<ExtensionProviders> | ||
<VaultRouter /> | ||
</ExtensionProviders> | ||
</ApolloProvider> | ||
</HashRouter> | ||
) | ||
|