1- import { Select } from "antd" ;
21import React , { useContext , useEffect , useState } from "react" ;
32import styled from "styled-components" ;
43import { useAppSelector } from "../../store/store" ;
54import colors from "../../styles/colors" ;
65import ClassificationText from "../ClassificationText" ;
76import ClassificationModal from "./ClassificationModal" ;
87import { VisualEditorContext } from "../Collaborative/VisualEditorProvider" ;
9-
10- const { Option } = Select ;
8+ import { MenuItem , Select , FormControl } from "@mui/material" ;
119
1210export const SelectInput = styled ( Select ) `
1311 background: ${ colors . white } ;
@@ -16,25 +14,23 @@ export const SelectInput = styled(Select)`
1614 border: none;
1715 height: 40px;
1816 width: 100%;
17+ padding: 10px;
1918
20- .ant-select-selector {
21- background: none !important;
22- border: none !important;
23- top: 6px;
24- .ant-select-selection-item {
25- color: ${ colors . blackSecondary } ;
26- }
27- }
19+ .MuiSelect-select {
20+ background: none !important;
21+ color: ${ colors . blackSecondary } ;
22+ padding: 0 !important;
23+ }
2824
29- .ant-select-selection-placeholder {
30- color: ${ colors . blackSecondary } ;
31- }
25+ .MuiOutlinedInput-notchedOutline {
26+ border: none !important ;
27+ }
3228
3329 ::placeholder {
3430 color: ${ colors . blackSecondary } ;
3531 }
3632
37- :focus {
33+ :focus .MuiOutlinedInput-notchedOutline {
3834 border: none;
3935 box-shadow: 0px 2px 2px ${ colors . shadow } ;
4036 }
@@ -43,7 +39,7 @@ export const SelectInput = styled(Select)`
4339 border: none;
4440 }
4541
46- :hover {
42+ :hover .MuiOutlinedInput-notchedOutline {
4743 border: none;
4844 }
4945` ;
@@ -57,11 +53,11 @@ const ClaimReviewSelect = ({
5753} ) => {
5854 const { vw } = useAppSelector ( ( state ) => state ) ;
5955 const [ open , setOpen ] = useState ( false ) ;
60- const [ value , setValue ] = useState ( defaultValue ) ;
56+ const [ value , setValue ] = useState ( defaultValue || "" ) ;
6157 const { editorConfiguration } = useContext ( VisualEditorContext ) ;
6258
6359 const onChangeSelect = ( e ) => {
64- setValue ( e ) ;
60+ setValue ( e . target . value ) ;
6561 } ;
6662
6763 useEffect ( ( ) => {
@@ -84,47 +80,49 @@ const ClaimReviewSelect = ({
8480
8581 return (
8682 < >
87- < SelectInput
88- type = { type }
89- onChange = { onChangeSelect }
90- onClick = { handleOnClick }
91- value = { value }
92- disabled = { editorConfiguration ?. readonly }
93- data-cy = { "testClassificationText" }
94- dropdownStyle = { vw ?. sm && { display : "none" } }
95- style = { style }
96- >
97- < Option value = "" disabled >
98- { placeholder }
99- </ Option >
100- < Option value = "not-fact" >
101- < ClassificationText classification = "not-fact" />
102- </ Option >
103- < Option value = "trustworthy" >
104- < ClassificationText classification = "trustworthy" />
105- </ Option >
106- < Option value = "trustworthy-but" >
107- < ClassificationText classification = "trustworthy-but" />
108- </ Option >
109- < Option value = "arguable" >
110- < ClassificationText classification = "arguable" />
111- </ Option >
112- < Option value = "misleading" >
113- < ClassificationText classification = "misleading" />
114- </ Option >
115- < Option value = "false" >
116- < ClassificationText classification = "false" />
117- </ Option >
118- < Option value = "unsustainable" >
119- < ClassificationText classification = "unsustainable" />
120- </ Option >
121- < Option value = "exaggerated" >
122- < ClassificationText classification = "exaggerated" />
123- </ Option >
124- < Option value = "unverifiable" >
125- < ClassificationText classification = "unverifiable" />
126- </ Option >
127- </ SelectInput >
83+ < FormControl fullWidth >
84+ < SelectInput
85+ type = { type }
86+ onChange = { onChangeSelect }
87+ onClick = { handleOnClick }
88+ value = { value }
89+ disabled = { editorConfiguration ?. readonly }
90+ data-cy = { "testClassificationText" }
91+ dropdownStyle = { vw ?. sm && { display : "none" } }
92+ style = { style }
93+ >
94+ < MenuItem value = "" disabled >
95+ { placeholder }
96+ </ MenuItem >
97+ < MenuItem sx = { { fontFamily : "open-sans, sans-serif" } } value = "not-fact" >
98+ < ClassificationText classification = "not-fact" />
99+ </ MenuItem >
100+ < MenuItem sx = { { fontFamily : "open-sans, sans-serif" } } value = "trustworthy" >
101+ < ClassificationText classification = "trustworthy" />
102+ </ MenuItem >
103+ < MenuItem sx = { { fontFamily : "open-sans, sans-serif" } } value = "trustworthy-but" >
104+ < ClassificationText classification = "trustworthy-but" />
105+ </ MenuItem >
106+ < MenuItem sx = { { fontFamily : "open-sans, sans-serif" } } value = "arguable" >
107+ < ClassificationText classification = "arguable" />
108+ </ MenuItem >
109+ < MenuItem sx = { { fontFamily : "open-sans, sans-serif" } } value = "misleading" >
110+ < ClassificationText classification = "misleading" />
111+ </ MenuItem >
112+ < MenuItem sx = { { fontFamily : "open-sans, sans-serif" } } value = "false" >
113+ < ClassificationText classification = "false" />
114+ </ MenuItem >
115+ < MenuItem sx = { { fontFamily : "open-sans, sans-serif" } } value = "unsustainable" >
116+ < ClassificationText classification = "unsustainable" />
117+ </ MenuItem >
118+ < MenuItem sx = { { fontFamily : "open-sans, sans-serif" } } value = "exaggerated" >
119+ < ClassificationText classification = "exaggerated" />
120+ </ MenuItem >
121+ < MenuItem sx = { { fontFamily : "open-sans, sans-serif" } } value = "unverifiable" >
122+ < ClassificationText classification = "unverifiable" />
123+ </ MenuItem >
124+ </ SelectInput >
125+ </ FormControl >
128126 < ClassificationModal
129127 open = { open }
130128 value = { value }
0 commit comments