|
@@ -32,25 +32,31 @@ const StyledButton = styled.button`
|
|
color: ${({ theme }) => theme.INTERACTIVE_NORMAL};
|
|
color: ${({ theme }) => theme.INTERACTIVE_NORMAL};
|
|
padding: 0 10px;
|
|
padding: 0 10px;
|
|
min-height: unset;
|
|
min-height: unset;
|
|
-
|
|
|
|
|
|
+ text-transform: uppercase;
|
|
|
|
+
|
|
&:hover {
|
|
&:hover {
|
|
box-shadow: none;
|
|
box-shadow: none;
|
|
}
|
|
}
|
|
|
|
|
|
&.active {
|
|
&.active {
|
|
- background: ${({ theme }) => theme.PRIMARY};;
|
|
|
|
|
|
+ background: ${({ theme }) => theme.PRIMARY};
|
|
|
|
+ color: white;
|
|
|
|
+ outline: 3px solid ${({ theme }) => theme.BACKGROUND_TERTIARY};
|
|
|
|
+ border-radius: 10px;
|
|
}
|
|
}
|
|
`;
|
|
`;
|
|
|
|
|
|
export interface ModalProps {
|
|
export interface ModalProps {
|
|
value:string | number | readonly string[] | undefined,
|
|
value:string | number | readonly string[] | undefined,
|
|
extensions:string[]
|
|
extensions:string[]
|
|
|
|
+ activeExtension:number
|
|
setExtension: Function,
|
|
setExtension: Function,
|
|
onChange: React.ChangeEventHandler<HTMLInputElement> | undefined,
|
|
onChange: React.ChangeEventHandler<HTMLInputElement> | undefined,
|
|
}
|
|
}
|
|
export const FileInput: React.FC<ModalProps> = (props) => {
|
|
export const FileInput: React.FC<ModalProps> = (props) => {
|
|
|
|
|
|
- const {setExtension, onChange,extensions,value } = props
|
|
|
|
|
|
+ const {setExtension, activeExtension, onChange,extensions,value } = props
|
|
|
|
+
|
|
return (
|
|
return (
|
|
<StyledInputWrapper>
|
|
<StyledInputWrapper>
|
|
<StyledForm>
|
|
<StyledForm>
|
|
@@ -60,9 +66,11 @@ export const FileInput: React.FC<ModalProps> = (props) => {
|
|
value={value}
|
|
value={value}
|
|
placeholder="File Name"
|
|
placeholder="File Name"
|
|
/>
|
|
/>
|
|
- {extensions.map((ext,key)=> (<StyledButton key={key} aria-label="search" onClick={()=> setExtension(key)}>
|
|
|
|
|
|
+ {extensions.map((ext, key) => (
|
|
|
|
+ <StyledButton className={`${activeExtension === key && "active"}`} key={key} aria-label="search" onClick={() => setExtension(key)}>
|
|
{ext}
|
|
{ext}
|
|
- </StyledButton>))}
|
|
|
|
|
|
+ </StyledButton>)
|
|
|
|
+ )}
|
|
|
|
|
|
</StyledForm>
|
|
</StyledForm>
|
|
</StyledInputWrapper>
|
|
</StyledInputWrapper>
|