Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Download QR Code #165

Open
ankitipistis opened this issue Oct 26, 2022 · 1 comment
Open

Download QR Code #165

ankitipistis opened this issue Oct 26, 2022 · 1 comment

Comments

@ankitipistis
Copy link

ankitipistis commented Oct 26, 2022

I am grateful for this library as I have generated QR Code. But I need to download it too , so according to the documentation I used react-native-fs but it's showing me some errors which is not resolving. May be this is happening because my project is in expo. Can anyone please help me with the codes.
note:- there is an expo-file-system too which can be used instead of react-native-fs
here is my QrGenerator.js file , I have a great hope from you guys please help me in this.
QrGenerator.txt

here I am Pasting my code from QrGenerator.js

import React, { useState } from 'react';
import {
Box, Heading, Center, Button,
NativeBaseProvider, Text, Input, FormControl, Stack
} from "native-base";
import QRCode from 'react-native-qrcode-svg';

// import { StyleSheet, View, Dimensions } from 'react-native';

export default function QrGenerator({ navigation }) {

const [input, setInput] = useState("name");

const handleChange = (text) => {
    setInput(text);
}

return (
    <NativeBaseProvider>
        <Center mt="20">

            <Heading color="#0891b2">VCard Generator</Heading>

            <Box marginTop="5">
                <QRCode value={input + "\n"} size={170} /> {/* Here is the QRCode from react-native-qrcode-svg */}
            </Box>
        </Center>

        <Box mt="5" width="90%" margin="auto" >

            <Text fontSize="md">Fill below parameters to generate your QR Code</Text>

            <FormControl>
                <Stack>
                    <FormControl.Label >Text</FormControl.Label>
                    <Input placeholder='Enter Text' onChangeText={text => handleChange(text)} />
                </Stack>
            </FormControl>

            <Button mt="5">Download QR</Button>
        </Box>
    </NativeBaseProvider>
)

}

@LouisMuriuki
Copy link

did you find a way?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants