Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Feat/new studio testnet #620

Merged
merged 14 commits into from
Dec 13, 2023
Merged
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@
"@rainbow-me/rainbowkit": "^1.2.0",
"@sentry/react": "^7.57.0",
"@subql/apollo-links": "^1.2.3",
"@subql/components": "1.0.3-20",
"@subql/components": "1.0.3-21",
"@subql/contract-sdk": "^0.100.3",
"@subql/network-clients": "^0.100.0",
"@subql/network-config": "^0.100.0",
Expand Down
2 changes: 1 addition & 1 deletion public/sw.js
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ workbox.setConfig({
workbox.routing.registerRoute(
// \/{0,1} will also match dev.thechaindata.comxxxyyy, but this is would not a valid suffix, so it can be use.
// for match dev.thechaindata.com & dev.thechaindata.com/
/((localhost:3006)|((dev|kepler)\.thechaindata\.com)|(kepler\.subquery\.network))\/{0,1}(?=((dashboard)|(explorer)|(profile)|(indexer)|(delegator)|(consumer)|(swap)|(studio))|\?|$).*/g,
/(((dev|kepler)\.thechaindata\.com)|(kepler\.subquery\.network))\/{0,1}(?=((dashboard)|(explorer)|(profile)|(indexer)|(delegator)|(consumer)|(swap)|(studio))|\?|$).*/g,
// https://developers.google.com/web/tools/workbox/reference-docs/latest/workbox.strategies
new workbox.strategies.NetworkFirst({
cacheName: 'workbox:html',
Expand Down
10 changes: 2 additions & 8 deletions src/App.tsx
Original file line number Diff line number Diff line change
@@ -1,11 +1,9 @@
// Copyright 2020-2022 SubQuery Pte Ltd authors & contributors
// SPDX-License-Identifier: Apache-2.0

import React, { PropsWithChildren, useMemo } from 'react';
import React, { PropsWithChildren } from 'react';
import { BrowserRouter } from 'react-router-dom';
import { AppInitProvider } from '@containers/AppInitialProvider';
import { useStudioEnabled } from '@hooks';
import { entryLinks, externalAppLinks, studioLink } from '@utils/links';

import { RainbowProvider } from './config/rainbowConf';
import { ChainStatus, Header } from './components';
Expand Down Expand Up @@ -40,15 +38,11 @@ const Providers: React.FC<PropsWithChildren> = ({ children }) => {
};

const RenderRouter: React.FC = () => {
const studioEnabled = useStudioEnabled();
const calEntryLinks = useMemo(() => (studioEnabled ? [...entryLinks, studioLink] : [...entryLinks]), [studioEnabled]);

return (
<BrowserRouter>
<div className="Main">
<div className="Header">
{/* TODO: replace with component from ui library */}
<Header appNavigation={calEntryLinks} dropdownLinks={{ label: 'Kepler', links: externalAppLinks }} />
<Header />
</div>

<div className="Content">
Expand Down
162 changes: 6 additions & 156 deletions src/components/Header/Header.module.less
Original file line number Diff line number Diff line change
@@ -1,159 +1,9 @@
.header {
width: 100%;
display: flex;
justify-content: space-between;
box-shadow: inset 0px -1px 0px rgba(26, 32, 44, 0.06);
padding: 1rem 1.25rem;

.expandIcon {
display: none;
font-size: 40px;
}

&Inner {
width: 100%;
}

&Logo {
display: flex;
}

&Right {
display: flex;
width: 100%;
align-items: center;
transition: all 0.2s linear;

}

.leftHeader {
display: inline-flex;
}
}

.justifyBetween {
justify-content: space-between;
}

.flexCenter {
display: flex;
align-items: center;
}

.leftElement {
margin-left: 2rem;
position: relative;
}

.appDropdown {
margin: 1rem;
}

.menuOverlay {
padding: 1rem !important;
}

.dropMenu {
width: 300px !important;
}

.navLink {
text-decoration: none;
margin: 0 1vw;
display: flex;
color: var(--gray700);
width: fit-content;
}

.navLink:hover {
text-decoration: underline;
color: var(--sq-primary-blue);
}

.navLinkCurrent {
font-weight: 500;
color: var(--sq-info);
}

@media screen and (max-width: 600px) {
.header {
flex-direction: column;
.expandIcon {
display: inline-block;
}

.middleHeader {
width: 100%;
}

&Logo {
width: 100%;
}

&Inner {
flex-direction: column;
width: 100vw;
padding: 0 20px;
.middleHeader {
flex-direction: column;
}

:global {
#leftHeader {
margin-left: 0;
}
}

.appDropdown {
width: 100%;
margin: 0;
padding: 14px 0;
border-bottom: 1px solid var(--sq-gray200);
:global {
.ant-space.ant-dropdown-trigger {
margin: 0 1vw;
}
}
}
}

&Right {
flex-direction: column;
}

&Item {
width: 100%;
padding: 14px 0;
border-top: 1px solid var(--sq-gray200);
border-bottom: 1px solid var(--sq-gray200);

& + .headerItem {
margin-top: -1px;
}
}

.hideOnMobile {
height: 0;
overflow: hidden;
}

.showExpand {
height: 570px;
}

.right {
width: 100%;
margin-bottom: 8px;

&>a {
width: 100%;
}
}

.leftHeader {
border-top: 1px solid var(--sq-gray200);
padding: 14px 0;
width: 100%;
:global {
.subql-header {
padding: 0 24px;
display: flex;
align-items: center;
}
}
}
}
Loading
Loading