convert const function to function
This commit is contained in:
@@ -4,7 +4,7 @@ import { open } from '@tauri-apps/api/dialog';
|
||||
import { Body, fetch } from '@tauri-apps/api/http';
|
||||
import { useState } from 'react';
|
||||
|
||||
export const AvatarUploader = ({ valueState }: { valueState: any }) => {
|
||||
export function AvatarUploader({ valueState }: { valueState: any }) {
|
||||
const [loading, setLoading] = useState(false);
|
||||
|
||||
const openFileDialog = async () => {
|
||||
@@ -72,4 +72,4 @@ export const AvatarUploader = ({ valueState }: { valueState: any }) => {
|
||||
)}
|
||||
</button>
|
||||
);
|
||||
};
|
||||
}
|
||||
|
||||
@@ -9,7 +9,7 @@ import { Body, fetch } from '@tauri-apps/api/http';
|
||||
import { useSetAtom } from 'jotai';
|
||||
import { useState } from 'react';
|
||||
|
||||
export const ImagePicker = ({ type }: { type: string }) => {
|
||||
export function ImagePicker({ type }: { type: string }) {
|
||||
let atom;
|
||||
|
||||
switch (type) {
|
||||
@@ -93,4 +93,4 @@ export const ImagePicker = ({ type }: { type: string }) => {
|
||||
)}
|
||||
</button>
|
||||
);
|
||||
};
|
||||
}
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
import { DEFAULT_AVATAR } from '@lume/stores/constants';
|
||||
|
||||
export const Image = (props) => {
|
||||
export function Image(props) {
|
||||
const addImageFallback = (event) => {
|
||||
event.currentTarget.src = DEFAULT_AVATAR;
|
||||
};
|
||||
@@ -8,4 +8,4 @@ export const Image = (props) => {
|
||||
return (
|
||||
<img {...props} loading="lazy" decoding="async" onError={addImageFallback} style={{ contentVisibility: 'auto' }} />
|
||||
);
|
||||
};
|
||||
}
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
import { useNetworkStatus } from '@lume/utils/hooks/useNetworkStatus';
|
||||
|
||||
export const NetworkStatusIndicator = () => {
|
||||
export function NetworkStatusIndicator() {
|
||||
const isOnline = useNetworkStatus();
|
||||
|
||||
return (
|
||||
@@ -18,4 +18,4 @@ export const NetworkStatusIndicator = () => {
|
||||
<p className="text-xs font-medium text-zinc-500">{isOnline ? 'Online' : 'Offline'}</p>
|
||||
</div>
|
||||
);
|
||||
};
|
||||
}
|
||||
|
||||
@@ -12,6 +12,6 @@ const pool = new RelayPool(FULL_RELAYS, {
|
||||
logSubscriptions: false,
|
||||
});
|
||||
|
||||
export default function RelayProvider({ children }: { children: React.ReactNode }) {
|
||||
export function RelayProvider({ children }: { children: React.ReactNode }) {
|
||||
return <RelayContext.Provider value={pool}>{children}</RelayContext.Provider>;
|
||||
}
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
import { autoUpdate, offset, shift, useFloating, useFocus, useHover, useInteractions } from '@floating-ui/react';
|
||||
import { useState } from 'react';
|
||||
|
||||
export default function Tooltip({ children, message }: { children: React.ReactNode; message: string }) {
|
||||
export function Tooltip({ children, message }: { children: React.ReactNode; message: string }) {
|
||||
const [isOpen, setIsOpen] = useState(false);
|
||||
|
||||
const { x, y, strategy, refs, context } = useFloating({
|
||||
|
||||
Reference in New Issue
Block a user