|
|
@@ -7,8 +7,12 @@ import {
|
|
|
import stylesheet from "./stylesheet";
|
|
|
import {
|
|
|
NCoreUIKitLocalize,
|
|
|
+ NCoreUIKitSnackBar,
|
|
|
+ NCoreUIKitTheme,
|
|
|
PageContainer,
|
|
|
+ CodeViewer,
|
|
|
SnackBar,
|
|
|
+ Button,
|
|
|
Header,
|
|
|
Text
|
|
|
} from "ncore-ui-kit";
|
|
|
@@ -25,6 +29,10 @@ const SnackBarPage = () => {
|
|
|
localize
|
|
|
} = NCoreUIKitLocalize.useContext();
|
|
|
|
|
|
+ const {
|
|
|
+ spaces
|
|
|
+ } = NCoreUIKitTheme.useContext();
|
|
|
+
|
|
|
const navigation = useNavigation<NativeStackNavigationProp<RootStackParamList>>();
|
|
|
|
|
|
useLayoutEffect(() => {
|
|
|
@@ -67,7 +75,6 @@ const SnackBarPage = () => {
|
|
|
>
|
|
|
{localize("components-snackBar")}
|
|
|
</Text>
|
|
|
-
|
|
|
<View
|
|
|
style={stylesheet.customContainer}
|
|
|
>
|
|
|
@@ -77,6 +84,34 @@ const SnackBarPage = () => {
|
|
|
type="primary"
|
|
|
id="example-snackbar"
|
|
|
/>
|
|
|
+ <Button
|
|
|
+ onPress={() => {
|
|
|
+ NCoreUIKitSnackBar.open({
|
|
|
+ subTitle: "This is an example subtitle",
|
|
|
+ title: "This is an example SnackBar",
|
|
|
+ type: "primary"
|
|
|
+ });
|
|
|
+ }}
|
|
|
+ title="Open SnackBar"
|
|
|
+ />
|
|
|
+ </View>
|
|
|
+ <View
|
|
|
+ style={{
|
|
|
+ marginTop: spaces.spacingMd
|
|
|
+ }}
|
|
|
+ >
|
|
|
+ <Text
|
|
|
+ variant="headlineSmallSize"
|
|
|
+ style={{
|
|
|
+ marginBottom: spaces.spacingSm
|
|
|
+ }}
|
|
|
+ >
|
|
|
+ {localize("usage")}
|
|
|
+ </Text>
|
|
|
+ <CodeViewer
|
|
|
+ code={"import {\n NCoreUIKitSnackBar\n} from \"ncore-ui-kit\";\n\nNCoreUIKitSnackBar.open({\n title: \"Title\",\n subTitle: \"Subtitle\",\n type: \"primary\"\n});"}
|
|
|
+ language="tsx"
|
|
|
+ />
|
|
|
</View>
|
|
|
</View>
|
|
|
</PageContainer>;
|