@daeryun/dr_components 0.1.7 → 0.1.9

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,73 +0,0 @@
1
- import style from '../../pages/broadcast/index.module.css';
2
- import Image from 'next/image';
3
- import React from 'react';
4
- import { useTranslation } from 'next-i18next';
5
- import { useRouter } from 'next/router';
6
- const SearchBar = (props) => {
7
- const { search, placeholder, maxLength, isIntegrate, isMarginNotAuto, marginTop, marginBottom } = props;
8
- const router = useRouter();
9
- const { t } = useTranslation('common');
10
- const handleInputChange = (e) => {
11
- props.onChange(e);
12
- };
13
- const handleOnKeyPress = (e) => {
14
- if (props.isKeyPress) {
15
- if (e.key === 'Enter') {
16
- props.onClick();
17
- }
18
- }
19
- };
20
- const handleClick = () => {
21
- props.onClick();
22
- };
23
- return (<div className={isIntegrate
24
- ? 'w-full h-auto '
25
- : 'w-full h-auto ' +
26
- `${marginTop
27
- ? 'mt-[' +
28
- marginTop[0] +
29
- 'px] max-md:mt-[' +
30
- marginTop[1] +
31
- 'px] max-sm:mt-[' +
32
- marginTop[2] +
33
- 'px]'
34
- : 'mt-[150px] max-md:mt-[80px] max-sm:mt-[50px]'}` +
35
- `${marginBottom ? 'mb-[' + marginBottom + 'px]' : 'mb-[90px]'}`}>
36
- <div className={'relative lg:w-[80%] sm:w-[90%] w-[100%] max-w-[855px] ' + `${isMarginNotAuto ? '' : 'm-auto'}`}>
37
- <input name="sear_txt" id={style.sear_txt} placeholder={placeholder} maxLength={maxLength ? maxLength : 20} value={search} onChange={handleInputChange} onKeyUp={handleOnKeyPress} spellCheck={false} className={`bg-[${isIntegrate ? '#FFFFFF' : '#F7F7F7'}] w-[100%] px-[40px] py-[24px] rounded-full ` +
38
- 'text-2xl text-[#333333] tracking-[-0.6px] placeholder:text-[#adadad] ' +
39
- //1500px
40
- 'max-3xl:text-xl ' +
41
- //768px
42
- 'max-md:text-lg max-md:py-[20px] max-md:pl-[40px] max-md:pr-[150px] ' +
43
- //640px
44
- 'max-sm:text-base max-sm:py-[18px] max-sm:pl-[25px] max-sm:pr-[65px] ' +
45
- //325px
46
- 'max-3xs:text-sm max-3xs:py-[15px] max-3xs:pl-[20px] max-3xs:pr-[55px] '}/>
47
- <div onClick={handleClick} className={'absolute top-[50%] translate-y-[-50%] right-[20px] z-10 ' +
48
- 'w-[140px] h-[65%] bg-[#2E2E2E] rounded-full cursor-pointer ' +
49
- 'flex justify-center items-center gap-[10px] ' +
50
- //768px
51
- 'max-md:w-[120px] ' +
52
- //640px
53
- 'max-sm:hidden '}>
54
- <Image src="/images/integrate/search.webp" alt="로고" width={30} height={30} className="w-[22px] h-auto max-md:w-[18px]"/>
55
- <span className={'text-[#fff] text-xl font-[800] tracking-[-0.5px] ' +
56
- //1500px
57
- 'max-3xl:text-lg ' +
58
- //768px
59
- 'max-md:text-base '}>
60
- 검색
61
- </span>
62
- </div>
63
- <div onClick={handleClick} className={'bg-[#2E2E2E] cursor-pointer absolute z-10 right-[15px] top-[50%] translate-y-[-50%] rounded-[30px] flex justify-center items-center sm:hidden ' +
64
- //650px
65
- 'w-[40px] h-[40px] ' +
66
- //325px
67
- 'max-3xs:w-[32px] max-3xs:h-[32px]'}>
68
- <Image src="/images/integrate/search.webp" alt="로고" width={26} height={26} className={'w-[18px] h-auto max-3xs:w-[16px]'}/>
69
- </div>
70
- </div>
71
- </div>);
72
- };
73
- export default SearchBar;
@@ -1,139 +0,0 @@
1
- import style from '../../pages/broadcast/index.module.css'
2
- import Image from 'next/image'
3
- import React, { useState } from 'react'
4
- import { useTranslation } from 'next-i18next'
5
- import { useRouter } from 'next/router'
6
-
7
- const SearchBar = (props: {
8
- // pathname: string
9
- onChange: (e: React.FormEvent<HTMLInputElement>) => void
10
- onClick: () => void
11
- search: string
12
- isKeyPress?: boolean
13
- placeholder: string
14
- maxLength?: number
15
- isIntegrate?: boolean
16
- isMarginNotAuto?: boolean //중앙정렬 아닐 시 true
17
- marginTop?: [number, number, number] //기본값 존재, 순서대로 all, 768px, 640px
18
- marginBottom?: number //기본값 존재
19
- }) => {
20
- const { search, placeholder, maxLength, isIntegrate, isMarginNotAuto, marginTop, marginBottom } = props
21
- const router = useRouter()
22
- const { t } = useTranslation('common')
23
-
24
- const handleInputChange = (e: React.FormEvent<HTMLInputElement>) => {
25
- props.onChange(e)
26
- }
27
- const handleOnKeyPress = (e: any) => {
28
- if (props.isKeyPress) {
29
- if (e.key === 'Enter') {
30
- props.onClick()
31
- }
32
- }
33
- }
34
- const handleClick = () => {
35
- props.onClick()
36
- }
37
-
38
- return (
39
- <div
40
- className={
41
- isIntegrate
42
- ? 'w-full h-auto '
43
- : 'w-full h-auto ' +
44
- `${
45
- marginTop
46
- ? 'mt-[' +
47
- marginTop[0] +
48
- 'px] max-md:mt-[' +
49
- marginTop[1] +
50
- 'px] max-sm:mt-[' +
51
- marginTop[2] +
52
- 'px]'
53
- : 'mt-[150px] max-md:mt-[80px] max-sm:mt-[50px]'
54
- }` +
55
- `${marginBottom ? 'mb-[' + marginBottom + 'px]' : 'mb-[90px]'}`
56
- }
57
- >
58
- <div
59
- className={
60
- 'relative lg:w-[80%] sm:w-[90%] w-[100%] max-w-[855px] ' + `${isMarginNotAuto ? '' : 'm-auto'}`
61
- }
62
- >
63
- <input
64
- name="sear_txt"
65
- id={style.sear_txt}
66
- placeholder={placeholder}
67
- maxLength={maxLength ? maxLength : 20}
68
- value={search}
69
- onChange={handleInputChange}
70
- onKeyUp={handleOnKeyPress}
71
- spellCheck={false}
72
- className={
73
- `bg-[${isIntegrate ? '#FFFFFF' : '#F7F7F7'}] w-[100%] px-[40px] py-[24px] rounded-full ` +
74
- 'text-2xl text-[#333333] tracking-[-0.6px] placeholder:text-[#adadad] ' +
75
- //1500px
76
- 'max-3xl:text-xl ' +
77
- //768px
78
- 'max-md:text-lg max-md:py-[20px] max-md:pl-[40px] max-md:pr-[150px] ' +
79
- //640px
80
- 'max-sm:text-base max-sm:py-[18px] max-sm:pl-[25px] max-sm:pr-[65px] ' +
81
- //325px
82
- 'max-3xs:text-sm max-3xs:py-[15px] max-3xs:pl-[20px] max-3xs:pr-[55px] '
83
- }
84
- />
85
- <div
86
- onClick={handleClick}
87
- className={
88
- 'absolute top-[50%] translate-y-[-50%] right-[20px] z-10 ' +
89
- 'w-[140px] h-[65%] bg-[#2E2E2E] rounded-full cursor-pointer ' +
90
- 'flex justify-center items-center gap-[10px] ' +
91
- //768px
92
- 'max-md:w-[120px] ' +
93
- //640px
94
- 'max-sm:hidden '
95
- }
96
- >
97
- <Image
98
- src="/images/integrate/search.webp"
99
- alt="로고"
100
- width={30}
101
- height={30}
102
- className="w-[22px] h-auto max-md:w-[18px]"
103
- />
104
- <span
105
- className={
106
- 'text-[#fff] text-xl font-[800] tracking-[-0.5px] ' +
107
- //1500px
108
- 'max-3xl:text-lg ' +
109
- //768px
110
- 'max-md:text-base '
111
- }
112
- >
113
- 검색
114
- </span>
115
- </div>
116
- <div
117
- onClick={handleClick}
118
- className={
119
- 'bg-[#2E2E2E] cursor-pointer absolute z-10 right-[15px] top-[50%] translate-y-[-50%] rounded-[30px] flex justify-center items-center sm:hidden ' +
120
- //650px
121
- 'w-[40px] h-[40px] ' +
122
- //325px
123
- 'max-3xs:w-[32px] max-3xs:h-[32px]'
124
- }
125
- >
126
- <Image
127
- src="/images/integrate/search.webp"
128
- alt="로고"
129
- width={26}
130
- height={26}
131
- className={'w-[18px] h-auto max-3xs:w-[16px]'}
132
- />
133
- </div>
134
- </div>
135
- </div>
136
- )
137
- }
138
-
139
- export default SearchBar