actual/packages/desktop-client/src/components/manager/ServerURL.js
Tom French dc53a74459
Separate external, monorepo and internal imports (#237)
* style: enforce ordering of imports

* style: sort imports in loot-core

* style: sort imports in desktop-client

* style: sort imports in loot-design

* style: manual fixes
2022-09-02 12:43:37 +01:00

39 lines
872 B
JavaScript

import React, { useState, useEffect } from 'react';
import { View, Text, AnchorLink } from 'loot-design/src/components/common';
import { send } from 'loot-core/src/platform/client/fetch';
export default function ServerURL() {
let [url, setUrl] = useState(null);
useEffect(() => {
async function run() {
let url = await send('get-server-url');
setUrl(url);
}
run();
}, []);
return (
<View
style={{
position: 'absolute',
bottom: 0,
left: 0,
right: 0,
justifyContent: 'center',
flexDirection: 'row',
marginBottom: 15,
zIndex: 5000
}}
>
<Text>
Using server: <strong>{url || '(not configured)'}</strong>
</Text>
<AnchorLink bare to="/config-server" style={{ marginLeft: 15 }}>
Change
</AnchorLink>
</View>
);
}