-
Notifications
You must be signed in to change notification settings - Fork 8
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
12 changed files
with
140 additions
and
15 deletions.
There are no files selected for viewing
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
import { memo } from 'react' | ||
import { SvgIconComponent } from '../SvgIconComponent' | ||
import {PRIMITIVE_COLORS} from '@nilfoundation/ui-kit' | ||
|
||
const Upload: SvgIconComponent = ({ className }) => ( | ||
<svg viewBox="0 0 16 16" xmlns="http://www.w3.org/2000/svg" className={className}> | ||
<rect x="2" y="8" width="1" height="6" fill={PRIMITIVE_COLORS.gray200} /> | ||
<rect x="13" y="8" width="1" height="6" fill={PRIMITIVE_COLORS.gray200} /> | ||
<rect transform="rotate(90 14 13)" x="14" y="13" width="1" height="12" fill={PRIMITIVE_COLORS.gray200} /> | ||
<path d="m8 10-3.3536-3.3535 0.70711-0.70711 2.1464 2.1464v-6.7929h1v6.7929l2.1464-2.1464 0.7071 0.70711-3.3535 3.3535z" clip-rule="evenodd" fill={PRIMITIVE_COLORS.gray200} fill-rule="evenodd"/> | ||
</svg> | ||
) | ||
|
||
export default memo(Upload) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
23 changes: 23 additions & 0 deletions
23
site/src/components/pages/OpenJobs/FileInput/FileInput.module.scss
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
.container { | ||
display: flex; | ||
flex-direction: column; | ||
gap: 16px; | ||
} | ||
|
||
.inputsContainer { | ||
position: relative; | ||
width: 134px; | ||
height: 46px; | ||
} | ||
|
||
.input { | ||
z-index: 2; | ||
width: 100%; | ||
height: 100%; | ||
position: absolute; | ||
cursor: pointer; | ||
// remove inner button | ||
&::-webkit-file-upload-button { | ||
display: none; | ||
} | ||
} |
29 changes: 29 additions & 0 deletions
29
site/src/components/pages/OpenJobs/FileInput/FileInput.tsx
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,29 @@ | ||
import { Input } from '@nilfoundation/ui-kit' | ||
import {forwardRef} from 'react' | ||
import {inputOverrids} from './overrides' | ||
import s from './FileInput.module.scss' | ||
import {UseFormRegisterReturn} from 'react-hook-form' | ||
import Icon from 'components/Icon' | ||
|
||
type FileInputProps = Omit<UseFormRegisterReturn<any>, "ref"> | ||
|
||
const FileInput = forwardRef<HTMLInputElement, FileInputProps>((props, ref) => { | ||
const placeholder = 'Attach file' | ||
return ( | ||
<div className={s.container}> | ||
<div className={s.inputsContainer}> | ||
<input | ||
className={s.input} | ||
type="file" | ||
{...props} | ||
ref={ref} | ||
accept="application/pdf,application/msword, application/vnd.openxmlformats-officedocument.wordprocessingml.document" | ||
/> | ||
<Input overrides={inputOverrids} placeholder={placeholder} readOnly endEnhancer={<Icon name="upload" />} /> | ||
</div> | ||
</div> | ||
) | ||
}) | ||
|
||
FileInput.displayName = 'FileInput' | ||
export default FileInput |
Empty file.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
import {InputOverrides} from "baseui/input"; | ||
|
||
export const inputOverrids: InputOverrides = { | ||
Root: { | ||
style: { | ||
width: "100%", | ||
height: "100%", | ||
position: "absolute", | ||
top: 0, | ||
left: 0, | ||
}, | ||
}, | ||
Input: { | ||
style: { | ||
appearance: "none", | ||
}, | ||
}, | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters