Skip to content

Commit abf3eb1

Browse files
committed
feat: add noShadow class to SearchBar and apply it in TopicSettings
1 parent 9e51085 commit abf3eb1

File tree

3 files changed

+14
-2
lines changed

3 files changed

+14
-2
lines changed

src/assets/App.css

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1016,6 +1016,9 @@ Producthunt item
10161016
width: 100%;
10171017
background-color: var(--card-header-background-color);
10181018

1019+
&.noShadow {
1020+
box-shadow: none;
1021+
}
10191022
&::placeholder {
10201023
color: var(--primary-text-color);
10211024
font-size: 0.9em;

src/components/Elements/SearchBar/SearchBar.tsx

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,20 @@
1+
import { clsx } from 'clsx'
12
import React, { useEffect, useRef } from 'react'
23

34
type SearchBarProps = {
45
iconStart?: React.ReactNode
56
placeholder: string
7+
inputClassName?: string
68
onSubmit?: (keyword: string) => void
79
onChange?: (keyword: string) => void
810
}
9-
export const SearchBar = ({ iconStart, placeholder, onChange, onSubmit }: SearchBarProps) => {
11+
export const SearchBar = ({
12+
iconStart,
13+
placeholder,
14+
onChange,
15+
onSubmit,
16+
inputClassName,
17+
}: SearchBarProps) => {
1018
const keywordsInputRef = useRef<HTMLInputElement | null>(null)
1119

1220
const handleSubmit = (e: React.FormEvent) => {
@@ -30,7 +38,7 @@ export const SearchBar = ({ iconStart, placeholder, onChange, onSubmit }: Search
3038
type="text"
3139
name="keyword"
3240
onChange={(e) => onChange?.(e.target.value)}
33-
className="searchBarInput"
41+
className={clsx('searchBarInput shadow', inputClassName)}
3442
placeholder={placeholder}
3543
/>
3644
</form>

src/features/settings/components/TopicSettings.tsx

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -97,6 +97,7 @@ export const TopicSettings = () => {
9797
<SearchBar
9898
iconStart={<IoMdSearch className="searchBarIcon" />}
9999
placeholder="Search by programming language, framework, or topic"
100+
inputClassName="noShadow"
100101
onChange={(keyword) => {
101102
setSearchKeyword(keyword)
102103
}}

0 commit comments

Comments
 (0)