Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

refactor(InputBar): split logic into hooks and components #18753

Merged
merged 13 commits into from
Feb 18, 2025
Merged
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ import {useMemo} from 'react';
import cx from 'classnames';

import * as Icon from 'Components/Icon';
import {DraftState, generateConversationInputStorageKey} from 'Components/InputBar/util/DraftStateUtil';
import {DraftState, generateConversationInputStorageKey} from 'Components/InputBar/common/draftState/draftState';
import {useLocalStorage} from 'Hooks/useLocalStorage';

import {iconStyle} from './CellDescription.style';
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
/*
* Wire
* Copyright (C) 2022 Wire Swiss GmbH
* Copyright (C) 2024 Wire Swiss GmbH
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
Expand All @@ -17,4 +17,18 @@
*
*/

export * from './MessageTimerButton';
import {PastedFileControls} from '../PastedFileControls/PastedFileControls';

interface FileInputProps {
pastedFile: File | null;
onClearPastedFile: () => void;
onSendPastedFile: () => void;
}

export const FileInput = ({pastedFile, onClearPastedFile, onSendPastedFile}: FileInputProps) => {
if (!pastedFile) {
return null;
}

return <PastedFileControls pastedFile={pastedFile} onClear={onClearPastedFile} onSend={onSendPastedFile} />;
};
Loading
Loading