update country list, remove app name from topbar
This commit is contained in:
@@ -1,10 +1,10 @@
|
||||
use once_cell::sync::Lazy;
|
||||
use serde::{Deserialize, Serialize};
|
||||
use tauri::State;
|
||||
use tracing::{debug, instrument};
|
||||
use ts_rs::TS;
|
||||
|
||||
use crate::{
|
||||
country::DEFAULT_NODE_LOCATION,
|
||||
error::{CmdError, CmdErrorSource},
|
||||
states::{app::Country, SharedAppData, SharedAppState},
|
||||
};
|
||||
@@ -15,11 +15,6 @@ pub enum NodeType {
|
||||
Exit,
|
||||
}
|
||||
|
||||
static DEFAULT_NODE_LOCATION: Lazy<Country> = Lazy::new(|| Country {
|
||||
code: "DE".to_string(),
|
||||
name: "Germany".to_string(),
|
||||
});
|
||||
|
||||
#[instrument(skip(app_state, data_state))]
|
||||
#[tauri::command]
|
||||
pub async fn set_node_location(
|
||||
|
||||
@@ -6,20 +6,29 @@ use crate::states::app::Country;
|
||||
pub static COUNTRIES: Lazy<Vec<Country>> = Lazy::new(|| {
|
||||
vec![
|
||||
Country {
|
||||
name: "Ireland".to_string(),
|
||||
code: "IE".to_string(),
|
||||
name: "France".to_string(),
|
||||
code: "FR".to_string(),
|
||||
},
|
||||
Country {
|
||||
name: "Germany".to_string(),
|
||||
code: "DE".to_string(),
|
||||
},
|
||||
Country {
|
||||
name: "Ireland".to_string(),
|
||||
code: "IE".to_string(),
|
||||
},
|
||||
Country {
|
||||
name: "Japan".to_string(),
|
||||
code: "JP".to_string(),
|
||||
},
|
||||
Country {
|
||||
name: "Great Britain".to_string(),
|
||||
name: "United Kingdom".to_string(),
|
||||
code: "GB".to_string(),
|
||||
},
|
||||
]
|
||||
});
|
||||
|
||||
pub static DEFAULT_NODE_LOCATION: Lazy<Country> = Lazy::new(|| Country {
|
||||
code: "FR".to_string(),
|
||||
name: "France".to_string(),
|
||||
});
|
||||
|
||||
@@ -20,7 +20,7 @@ export default function QuickConnect({ onClick }: QuickConnectProps) {
|
||||
}
|
||||
>
|
||||
<span className="font-icon text-2xl px-4 cursor-pointer">bolt</span>
|
||||
<div className="cursor-pointer">{`${QuickConnectPrefix} ${defaultNodeLocation.name}`}</div>
|
||||
<div className="cursor-pointer">{`${QuickConnectPrefix} (${defaultNodeLocation.name})`}</div>
|
||||
</div>
|
||||
);
|
||||
}
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
import { useEffect, useMemo, useState } from 'react';
|
||||
import { useLocation, useNavigate } from 'react-router-dom';
|
||||
import { useTranslation } from 'react-i18next';
|
||||
import { AppName, routes } from '../constants';
|
||||
import { routes } from '../constants';
|
||||
import { Routes } from '../types';
|
||||
|
||||
type NavLocation = {
|
||||
@@ -22,7 +22,7 @@ export default function TopBar() {
|
||||
const { t } = useTranslation();
|
||||
|
||||
const [currentNavLocation, setCurrentNavLocation] = useState<NavLocation>({
|
||||
title: AppName,
|
||||
title: '',
|
||||
rightIcon: 'settings',
|
||||
handleRightNav: () => {
|
||||
navigate(routes.settings);
|
||||
@@ -32,7 +32,7 @@ export default function TopBar() {
|
||||
const navBarData = useMemo<NavBarData>(() => {
|
||||
return {
|
||||
'/': {
|
||||
title: AppName,
|
||||
title: '',
|
||||
rightIcon: 'settings',
|
||||
handleRightNav: () => {
|
||||
navigate(routes.settings);
|
||||
|
||||
Reference in New Issue
Block a user