popup ariaHidden
This commit is contained in:
@@ -101,14 +101,9 @@ export default function TPopUp({
|
||||
...rest
|
||||
}) {
|
||||
const dispatch = useDispatch();
|
||||
|
||||
const popupVisible = useSelector((state) => state.common.popup.popupVisible);
|
||||
const httpHeader = useSelector((state) => state.common.httpHeader);
|
||||
|
||||
const deviceCountryCode = httpHeader?.["X-Device-Country"] || "";
|
||||
|
||||
const [ariaHidden, setAriaHidden] = useState(false);
|
||||
|
||||
useEffect(() => {
|
||||
if (popupVisible) {
|
||||
if (spotlightId) {
|
||||
@@ -203,13 +198,14 @@ export default function TPopUp({
|
||||
[onRightClick]
|
||||
);
|
||||
|
||||
useEffect(() => {
|
||||
const ariaHidden = useMemo(() => {
|
||||
const deviceCountryCode = httpHeader?.["X-Device-Country"] || "";
|
||||
if (deviceCountryCode === "US") {
|
||||
setAriaHidden(false);
|
||||
return false;
|
||||
} else {
|
||||
setAriaHidden(true);
|
||||
return true;
|
||||
}
|
||||
}, [deviceCountryCode]);
|
||||
}, [httpHeader]);
|
||||
|
||||
return (
|
||||
<Alert
|
||||
|
||||
Reference in New Issue
Block a user