actual/packages/desktop-client/src/components/manager/ServerURL.js
Tom French 9c0df36e16
Sort import in alphabetical order (#238)
* style: enforce sorting of imports

* style: alphabetize imports

* style: merge duplicated imports
2022-09-02 15:07:24 +01:00

39 lines
872 B
JavaScript

import React, { useState, useEffect } from 'react';
import { send } from 'loot-core/src/platform/client/fetch';
import { View, Text, AnchorLink } from 'loot-design/src/components/common';
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>
);
}