Skip to content

Commit

Permalink
chore: unused vars removed (#1383)
Browse files Browse the repository at this point in the history
  • Loading branch information
PritishBudhiraja authored Sep 16, 2024
1 parent 2fee0ee commit 790040d
Show file tree
Hide file tree
Showing 80 changed files with 199 additions and 212 deletions.
2 changes: 1 addition & 1 deletion src/components/Accordion.res
Original file line number Diff line number Diff line change
Expand Up @@ -87,7 +87,7 @@ module AccordionInfo = {
) => {
let (isExpanded, setIsExpanded) = React.useState(() => expanded)

let handleClick = _e => {
let handleClick = _ => {
setIsExpanded(prevExpanded => !prevExpanded)
}

Expand Down
4 changes: 2 additions & 2 deletions src/components/Calendar.res
Original file line number Diff line number Diff line change
Expand Up @@ -116,7 +116,7 @@ module TableRow = {
| None => true
}

let onClick = _evt => {
let onClick = _ => {
let isClickDisabled =
(endDate->isEmptyString && !isInLimit) ||
(isFutureDate ? disableFutureDates : disablePastDates) ||
Expand Down Expand Up @@ -252,7 +252,7 @@ module TableRow = {
className={classN}
onClick
onMouseOver={_ => handleHover()}
onMouseOut={_evt => setHoverdDate(_ => "")}>
onMouseOut={_ => setHoverdDate(_ => "")}>
<AddDataAttributes
attributes=[
(
Expand Down
4 changes: 2 additions & 2 deletions src/components/CardTable.res
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ module CardDetails = {
~isAnalyticsModule,
) => {
let {globalUIConfig: {font: {textColor}}} = React.useContext(ThemeProvider.themeContext)
let onCardClick = _ev => {
let onCardClick = _ => {
switch onRowClick {
| Some(fn) => fn(rowIndex + offset)
| None => ()
Expand All @@ -53,7 +53,7 @@ module CardDetails = {

let (show, setshow) = React.useState(_ => true)

let showMore = _ev => {
let showMore = _ => {
setshow(prev => !prev)
}

Expand Down
2 changes: 1 addition & 1 deletion src/components/Chip.res
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ let make = (~values=[], ~showButton=false, ~onButtonClick=_ => (), ~converterFn=
<div className="flex flex-wrap flex-row">
{values
->Array.map(value => {
let onClick = _evt => {
let onClick = _ => {
onButtonClick(value)
}
<div
Expand Down
2 changes: 1 addition & 1 deletion src/components/DatePicker.res
Original file line number Diff line number Diff line change
Expand Up @@ -112,7 +112,7 @@ let make = (
setIsExpanded(p => !p)
},
)
let changeVisibility = _ev => {
let changeVisibility = _ => {
if !isDisabled {
setIsExpanded(p => !p)
}
Expand Down
10 changes: 5 additions & 5 deletions src/components/DateRangeField.res
Original file line number Diff line number Diff line change
Expand Up @@ -400,7 +400,7 @@ module Base = {
changeStartDate(str, true, None)
}

let handleApply = _ev => {
let handleApply = _ => {
setShowOption(_ => false)
setCalendarVisibility(p => !p)
setIsDropdownExpanded(_ => false)
Expand Down Expand Up @@ -440,7 +440,7 @@ module Base = {
}
let startTimeInput: ReactFinalForm.fieldRenderPropsInput = {
name: "string",
onBlur: _ev => (),
onBlur: _ => (),
onChange: timeValEv => {
let startTimeVal = timeValEv->Identity.formReactEventToString
let endTime = localEndDate->getTimeStringForValue(isoStringToCustomTimeZone)
Expand All @@ -457,13 +457,13 @@ module Base = {
}
}
},
onFocus: _ev => (),
onFocus: _ => (),
value: localStartDate->getTimeStringForValue(isoStringToCustomTimeZone)->JSON.Encode.string,
checked: false,
}
let endTimeInput: ReactFinalForm.fieldRenderPropsInput = {
name: "string",
onBlur: _ev => (),
onBlur: _ => (),
onChange: timeValEv => {
let endTimeVal = timeValEv->Identity.formReactEventToString
let startTime = localStartDate->getTimeStringForValue(isoStringToCustomTimeZone)
Expand All @@ -479,7 +479,7 @@ module Base = {
}
}
},
onFocus: _ev => (),
onFocus: _ => (),
value: localEndDate->getTimeStringForValue(isoStringToCustomTimeZone)->JSON.Encode.string,
checked: false,
}
Expand Down
10 changes: 5 additions & 5 deletions src/components/DateRangePicker.res
Original file line number Diff line number Diff line change
Expand Up @@ -403,7 +403,7 @@ module Base = {
changeStartDate(str, true, None)
}

let handleApply = _ev => {
let handleApply = _ => {
setShowOption(_ => false)
setCalendarVisibility(p => !p)
setIsDropdownExpanded(_ => false)
Expand Down Expand Up @@ -443,7 +443,7 @@ module Base = {
}
let startTimeInput: ReactFinalForm.fieldRenderPropsInput = {
name: "string",
onBlur: _ev => (),
onBlur: _ => (),
onChange: timeValEv => {
let startTimeVal = timeValEv->Identity.formReactEventToString
let endTime = localEndDate->getTimeStringForValue(isoStringToCustomTimeZone)
Expand All @@ -460,13 +460,13 @@ module Base = {
}
}
},
onFocus: _ev => (),
onFocus: _ => (),
value: localStartDate->getTimeStringForValue(isoStringToCustomTimeZone)->JSON.Encode.string,
checked: false,
}
let endTimeInput: ReactFinalForm.fieldRenderPropsInput = {
name: "string",
onBlur: _ev => (),
onBlur: _ => (),
onChange: timeValEv => {
let endTimeVal = timeValEv->Identity.formReactEventToString
let startTime = localStartDate->getTimeStringForValue(isoStringToCustomTimeZone)
Expand All @@ -482,7 +482,7 @@ module Base = {
}
}
},
onFocus: _ev => (),
onFocus: _ => (),
value: localEndDate->getTimeStringForValue(isoStringToCustomTimeZone)->JSON.Encode.string,
checked: false,
}
Expand Down
4 changes: 2 additions & 2 deletions src/components/DynamicChart.res
Original file line number Diff line number Diff line change
Expand Up @@ -324,7 +324,7 @@ module GranularitySelectBox = {
open HeadlessUI
<>
<Menu \"as"="div" className="relative inline-block text-left">
{_menuProps =>
{_ =>
<div>
<Menu.Button
className="inline-flex whitespace-pre leading-5 justify-center text-sm px-3 py-1 font-medium rounded-md hover:bg-opacity-80 bg-white border">
Expand Down Expand Up @@ -352,7 +352,7 @@ module GranularitySelectBox = {
leaveTo="transform opacity-0 scale-95">
{<Menu.Items
className="absolute right-0 z-50 w-36 mt-2 origin-top-right bg-white dark:bg-jp-gray-950 divide-y divide-gray-100 rounded-md shadow-lg ring-1 ring-black ring-opacity-5 focus:outline-none">
{_props => {
{_ => {
<>
<div className="px-1 py-1 ">
{options
Expand Down
2 changes: 1 addition & 1 deletion src/components/DynamicFilter.res
Original file line number Diff line number Diff line change
Expand Up @@ -189,7 +189,7 @@ let make = (
buttonSize=Small
leftIcon={CustomIcon(<Icon name="add_custom_img" size=14 />)}
textStyle={`${textColor.primaryNormal}`}
onClick={_ev => setShowModal(_ => true)}
onClick={_ => setShowModal(_ => true)}
/>
</div>
<Modal
Expand Down
8 changes: 4 additions & 4 deletions src/components/DynamicTabs.res
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@ module TabInfo = {
} else {
"text-jp-gray-700 dark:text-jp-gray-tabset_gray dark:text-opacity-75 hover:text-jp-gray-800 dark:hover:text-opacity-100 font-medium"
}
let handleClick = React.useCallback(_ev => {
let handleClick = React.useCallback(_ => {
handleSelectedTab(
~tabValue={
switch tabNames->Array.get(index) {
Expand Down Expand Up @@ -171,7 +171,7 @@ module IndicationArrow = {
let make = (~iconName, ~side, ~refElement: React.ref<Js.nullable<Dom.element>>, ~isVisible) => {
let isMobileView = MatchMedia.useMobileChecker()
let onClick = {
_ev =>
_ =>
refElement.current
->Nullable.toOption
->Option.forEach(input =>
Expand Down Expand Up @@ -399,7 +399,7 @@ let make = (
let scrollRef = React.useRef(Nullable.null)
let lastTabRef = React.useRef(Nullable.null)

let onScroll = _ev => {
let onScroll = _ => {
setTabScroll(
firstTabRef,
lastTabRef,
Expand Down Expand Up @@ -595,7 +595,7 @@ let make = (
buttonSize=Small
customButtonStyle=addBtnStyle
textStyle=addBtnTextStyle
onClick={_ev => setShowModal(_ => true)}
onClick={_ => setShowModal(_ => true)}
/>}
toolTipPosition=Top
tooltipWidthClass="w-fit"
Expand Down
2 changes: 1 addition & 1 deletion src/components/Filter.res
Original file line number Diff line number Diff line change
Expand Up @@ -126,7 +126,7 @@ let make = (
~path="",
~remoteFilters: array<EntityType.initialFilters<'t>>,
~remoteOptions: array<EntityType.optionType<'t>>,
~localOptions as _: array<EntityType.optionType<'t>>,
~localOptions as _,
~localFilters: array<EntityType.initialFilters<'t>>,
~mandatoryRemoteKeys=[],
~popupFilterFields: array<EntityType.optionType<'t>>=[],
Expand Down
12 changes: 6 additions & 6 deletions src/components/FilterSelectBox.res
Original file line number Diff line number Diff line change
Expand Up @@ -539,7 +539,7 @@ module BaseSelect = {
setSearchString(_ => str)
}

let selectAll = select => _ev => {
let selectAll = select => _ => {
let newValues = if select {
let newVal =
filteredOptions
Expand Down Expand Up @@ -901,7 +901,7 @@ module BaseSelectButton = {
let (itemdata, setItemData) = React.useState(() => "")
let (assignButtonState, setAssignButtonState) = React.useState(_ => false)
let searchRef = React.useRef(Nullable.null)
let onItemClick = itemData => _ev => {
let onItemClick = itemData => _ => {
if !disableSelect {
let isSelected = value->JSON.Decode.string->Option.mapOr(false, str => itemData === str)

Expand Down Expand Up @@ -1212,7 +1212,7 @@ module BaseRadio = {
setSearchString(_ => "")
},
)
let onItemClick = (itemData, isDisabled) => _ev => {
let onItemClick = (itemData, isDisabled) => _ => {
if !isDisabled {
let isSelected = value->JSON.Decode.string->Option.mapOr(false, str => itemData === str)

Expand Down Expand Up @@ -1612,7 +1612,7 @@ module BaseDropdown = {
}
}

let removeOption = text => _ev => {
let removeOption = text => _ => {
let actualValue = switch Array.find(transformedOptions, option => option.value == text) {
| Some(str) => str.value
| None => ""
Expand Down Expand Up @@ -1682,8 +1682,8 @@ module BaseDropdown = {
| TopLeft | TopRight => "mb-12"
}

let onRadioOptionSelect = _ev => {
newInputRadio.onChange(_ev)
let onRadioOptionSelect = ev => {
newInputRadio.onChange(ev)
addButton ? setShowDropDown(_ => true) : setShowDropDown(_ => false)
}

Expand Down
8 changes: 4 additions & 4 deletions src/components/HeadlessUISelectBox.res
Original file line number Diff line number Diff line change
Expand Up @@ -38,9 +38,9 @@ let make = (
<div className="text-left">
<AddDataAttributes attributes=[("data-testid", "profile")]>
<Menu \"as"="div" className="relative inline-block text-left">
{_menuProps =>
{_ =>
<div>
<Menu.Button className> {_buttonProps => children} </Menu.Button>
<Menu.Button className> {_ => children} </Menu.Button>
<Transition
\"as"="span"
enter="transition ease-out duration-100"
Expand All @@ -53,7 +53,7 @@ let make = (
<BottomModal headerText="Select Action" onCloseClick=closeClick>
<Menu.Items
className={`w-full p-1 origin-top-right bg-white dark:bg-jp-gray-950 rounded-md shadow-lg ring-1 ring-black ring-opacity-5 focus:outline-none`}>
{_props =>
{_ =>
options
->Array.mapWithIndex((option, index) => {
let selected = switch value {
Expand Down Expand Up @@ -137,7 +137,7 @@ let make = (
} else {
<Menu.Items
className={`absolute z-10 ${dropdownPositionClass} mt-2 p-1 origin-top-right bg-white dark:bg-jp-gray-950 rounded-md shadow-lg ring-1 ring-black ring-opacity-5 focus:outline-none ${dropDownClass}`}>
{_props =>
{_ =>
options
->Array.mapWithIndex((option, index) => {
let selected = switch value {
Expand Down
2 changes: 1 addition & 1 deletion src/components/InfraCalendar.res
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,7 @@ module TableRow = {
)
let isFutureDate = todayInitial -. date->Date.getTime < 0.0

let onClick = _evt => {
let onClick = _ => {
let isClickDisabled = isFutureDate ? disableFutureDates : disablePastDates
switch !isClickDisabled {
| true =>
Expand Down
4 changes: 2 additions & 2 deletions src/components/InfraCalendarList.res
Original file line number Diff line number Diff line change
Expand Up @@ -130,8 +130,8 @@ module MonthItem = {
open InfraCalendar
@react.component
let make = (
~month as _: option<month>=?,
~year as _: option<int>=?,
~month as _,
~year as _,
~onDateClick=?,
~cellHighlighter=?,
~cellRenderer=?,
Expand Down
4 changes: 2 additions & 2 deletions src/components/NewCalendar.res
Original file line number Diff line number Diff line change
Expand Up @@ -97,7 +97,7 @@ module TableRow = {
| None => true
}

let onClick = _evt => {
let onClick = _ => {
switch setIsDateClicked {
| Some(setIsDateClicked) => setIsDateClicked(_ => true)
| _ => ()
Expand Down Expand Up @@ -308,7 +308,7 @@ module TableRow = {
className={`${classN} ${highlightBgClass} text-sm font-normal`}
onClick
onMouseOver={_ => handleHover()}
onMouseOut={_evt => setHoverdDate(_ => "")}>
onMouseOut={_ => setHoverdDate(_ => "")}>
<AddDataAttributes
attributes=[
(
Expand Down
10 changes: 5 additions & 5 deletions src/components/NewPagination.res
Original file line number Diff line number Diff line change
Expand Up @@ -23,13 +23,13 @@ let make = (~resultsPerPage, ~totalResults, ~currentPage, ~paginate, ~btnCount=4
name="chevron-left"
className="fill-ardra-secondary-300"
size=16
onClick={_evt => paginate(Math.Int.max(1, currentPage - 1))}
onClick={_ => paginate(Math.Int.max(1, currentPage - 1))}
/>
} else {
<Icon
name="leftDisabledPaginator"
size=16
onClick={_evt => paginate(Math.Int.max(1, currentPage - 1))}
onClick={_ => paginate(Math.Int.max(1, currentPage - 1))}
/>
}}
{pageNumbers
Expand All @@ -39,7 +39,7 @@ let make = (~resultsPerPage, ~totalResults, ~currentPage, ~paginate, ~btnCount=4
<Button
key={idx->Int.toString}
text={number->Int.toString}
onClick={_evt => paginate(number)}
onClick={_ => paginate(number)}
buttonType={Pill}
customButtonStyle="rounded-[4px] w-[39px] h-[36px]"
textStyle="text-[#0E111E] text-[14px]"
Expand All @@ -49,9 +49,9 @@ let make = (~resultsPerPage, ~totalResults, ~currentPage, ~paginate, ~btnCount=4
})
->React.array}
{if currentPage < Array.length(pageNumbers) {
<Icon name="chevron-right" size=16 onClick={_evt => paginate(currentPage + 1)} />
<Icon name="chevron-right" size=16 onClick={_ => paginate(currentPage + 1)} />
} else {
<Icon name="rightDisabledPaginator" size=16 onClick={_evt => paginate(currentPage + 1)} />
<Icon name="rightDisabledPaginator" size=16 onClick={_ => paginate(currentPage + 1)} />
}}
</ButtonGroup>
}
Loading

0 comments on commit 790040d

Please sign in to comment.