fix sv network banner to always show#6087
Conversation
1247c2a to
4c6b159
Compare
4c6b159 to
fdc9384
Compare
fdc9384 to
987b1c0
Compare
987b1c0 to
d443441
Compare
|
hey @JYC11, thanks for the contribution! I'm going to review it in the closest future |
d443441 to
df5110f
Compare
pawelperek-da
left a comment
There was a problem hiding this comment.
Hi @JYC11, thanks for the contribution! Please remove the config.spliceInstanceNames.networkName branch and add special LocalNet handling and we are good to go
| userEvent.setup(); | ||
| render(<AppWithConfig />); | ||
|
|
||
| await screen.findByText('You are on ScratchNet'); |
There was a problem hiding this comment.
The text here should stay You are on ScratchNet, because the test mocks scratchnetb
| const config = useSvConfig(); | ||
| const dsoInfosQuery = useDsoInfos(); | ||
|
|
||
| const configured = config.spliceInstanceNames.networkName; |
There was a problem hiding this comment.
We cannot use spliceInstanceNames.networkName, as it's product branding (e.g. Splice) rather than a cluster name (e.g. ScratchNet), and it's intentionally the same across all clusters.
| } | ||
|
|
||
| return networkName; | ||
| return network.charAt(0).toUpperCase() + network.slice(1); |
There was a problem hiding this comment.
👍
I think it covers all the clusters apart of LocalNet (i.e. localhost:3211), so that will need a separate branch
| const knownColors = ['mainnet', 'testnet', 'devnet', 'scratchnet']; | ||
| const networkInstanceNameColor = knownColors.includes(networkInstanceName.toLowerCase()) | ||
| ? `colors.${networkInstanceName.toLowerCase()}` | ||
| : 'colors.neutral.30'; |
There was a problem hiding this comment.
I'm gonna consult the design team about the colourings
Signed-off-by: Jaeyoon Cho <jaeyoon.cho@obsidian.systems> Signed-off-by: JYC11 <jaeyoon.c@gmail.com>
Signed-off-by: JYC11 <jaeyoon.c@gmail.com>
Signed-off-by: JYC11 <jaeyoon.c@gmail.com>
416b876 to
f29dfa2
Compare
Signed-off-by: JYC11 <jaeyoon.c@gmail.com>
fixes: #534
Always show the "You are on " banner in the SV UI, including on clusters where it was previously hidden.
The network name is derived from the scan node's public URL: MainNet/TestNet/DevNet/ScratchNet from the cluster subdomain, LocalNet for localhost, and a capitalized fallback otherwise (Unknown Network when no scan URL is available).
The banner in the
Layoutcomponent has been changed to always show. For networks outside of the known networks, it will default to this color:colors.neutral.30screenshot:
