@@ -13,10 +13,6 @@ import {
1313 type LayoutChangeEvent ,
1414} from "react-native"
1515
16- import {
17- Spacing ,
18- } from "@audira/carbon-react-native-elements"
19-
2016import {
2117 GlobalConfigContext ,
2218} from "../../../_internal/contexts"
@@ -34,6 +30,10 @@ import {
3430 type ComponentWrapperRef ,
3531} from "./_component-wrapper"
3632
33+ import {
34+ Gap ,
35+ } from "./_gap"
36+
3737export const Overlay = forwardRef < OverlayRef > (
3838 function (
3939 ___props ,
@@ -91,12 +91,12 @@ export const Overlay = forwardRef<OverlayRef>(
9191 ) {
9292 componentWrappersRef . current [ index ] . cancelX ( ) // cancel the current delay first
9393 componentWrappersRef . current [ index ] . shiftX (
94- componentsConfig . current [ index ] . width + Spacing . spacing_03 ,
94+ componentsConfig . current [ index ] . width + Gap ,
9595 )
9696 if ( index > 0 ) {
9797 for ( let i = 0 ; i < index ; i ++ ) {
9898 componentWrappersRef . current [ i ] ?. shiftY (
99- - componentsConfig . current [ index ] . height - Spacing . spacing_03 ,
99+ - componentsConfig . current [ index ] . height - Gap ,
100100 )
101101 }
102102 }
@@ -127,14 +127,14 @@ export const Overlay = forwardRef<OverlayRef>(
127127 }
128128
129129 componentWrappersRef . current [ index ] . shiftX (
130- - componentsConfig . current [ index ] . width - Spacing . spacing_03 ,
130+ - componentsConfig . current [ index ] . width - Gap ,
131131 )
132132
133133 if ( componentWrappersRef . current . length > 1 ) {
134134 for ( let i = 0 ; i < componentWrappersRef . current . length - 1 ; i ++ ) {
135135 componentWrappersRef . current [ i ] ?. shiftY (
136136 // eslint-disable-next-line @typescript-eslint/no-unnecessary-type-assertion, @typescript-eslint/no-extra-non-null-assertion
137- componentsConfig . current [ 0 ] ! ! . height + Spacing . spacing_03 ,
137+ componentsConfig . current [ 0 ] ! ! . height + Gap ,
138138 )
139139 }
140140 }
@@ -151,12 +151,12 @@ export const Overlay = forwardRef<OverlayRef>(
151151
152152 if ( componentsConfig . current [ index ] ?. state === 1 ) {
153153 componentWrappersRef . current [ index ] ?. shiftX (
154- componentsConfig . current [ index ] . width + Spacing . spacing_03 ,
154+ componentsConfig . current [ index ] . width + Gap ,
155155 componentsConfig . current [ index ] . duration ?? globalConfigContext . toastDuration ,
156156 )
157157 } else if (
158158 componentsConfig . current [ index ] ?. state === 2 &&
159- ! componentsConfig . current . some ( config => config . state < 2 ) // somehow, the state may increase to "3" when it's dismissed by click/press. only god knows it.
159+ ! componentsConfig . current . some ( config => config . state < 2 )
160160 ) {
161161 // Delete all componentsConfig, componentWrappersRef, and components (react state) when it's all done
162162 componentsConfig . current . splice ( 0 , componentsConfig . current . length )
0 commit comments