How to use the react-toasts.ToastsStore.success function in react-toasts

To help you get started, we’ve selected a few react-toasts examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github Graphite-Docs / graphite / src / components / docs / views / MyDocs.js View on Github external
copyLink = () => {
    /* Get the text field */
    var copyText = document.getElementById("copyLink");
    /* Select the text field */
    copyText.select();

    /* Copy the text inside the text field */
    document.execCommand("copy");
    ToastsStore.success(`Link copied`)
  }
github Graphite-Docs / graphite / src / components / files / views / MyFiles.js View on Github external
copyLink = () => {
      /* Get the text field */
      var copyText = document.getElementById("copyLink");
      /* Select the text field */
      copyText.select();
  
      /* Copy the text inside the text field */
      document.execCommand("copy");
      ToastsStore.success(`Link copied`)
    }
github Graphite-Docs / graphite / src / components / files / helpers / teamFiles.js View on Github external
.then(async (res) => {
            console.log(res.data)
            if(res.data.success === false) {
                ToastsStore.error(res.data.message);
            } else {
                await loadData();
                ToastsStore.success(`File removed`);
            }
        }).catch((error) => {
            console.log(error);
github Graphite-Docs / graphite / src / components / pro / helpers / account.js View on Github external
.then((res) => {
            if(res.data.success === true) {
                handleProCheck();
                setGlobal({ orgNameModalOpen: false });
                ToastsStore.success("Account name updated!");
            } else {
                ToastsStore.error(res.data.message);
            }
        }).catch(err => console.log(err))
}
github Graphite-Docs / graphite / src / components / docs / helpers / teamDocs.js View on Github external
.then(async (res) => {
            console.log(res.data)
            if(res.data.success === false) {
                ToastsStore.error(res.data.message);
            } else {
                await loadData();
                ToastsStore.success(`Document removed`);
            }
        }).catch((error) => {
            console.log(error);
github Graphite-Docs / graphite / src / components / files / helpers / vaultTags.js View on Github external
export async function saveTags() {
    setGlobal({tagModalOpen: false})
    ToastsStore.success(`Saving tags...`)
    let file = getGlobal().singleFile;
    file["tags"] = getGlobal().tags;
    //Save the single file first
    try {
        let singleFileParams = {
            fileName: `${file.id}.json`, 
            body: JSON.stringify(file), 
            encrypt: true
        }
        let postedFile = await postData(singleFileParams)
        console.log(postedFile)
    } catch(error) {
        console.log(error)
    }
    //Then update the file collection and save it
    let files = await getGlobal().files;
github Graphite-Docs / graphite / src / components / forms / helpers / formTags.js View on Github external
export async function saveTags() {
    setGlobal({tagModalOpen: false})
    ToastsStore.success(`Saving tags...`)
    let form = getGlobal().singleForm;
    form["tags"] = getGlobal().tags;
    //Save the single file first
    try {
        let singleFormParams = {
            fileName: `forms/${form.id}.json`, 
            body: JSON.stringify(form), 
            encrypt: true
        }
        let postedForm = await postData(singleFormParams)
        console.log(postedForm)
    } catch(error) {
        console.log(error)
    }
    //Then update the forms collection and save it
    let forms = await getGlobal().forms;
github Graphite-Docs / graphite / src / components / docs / helpers / docsCollectionTags.js View on Github external
export async function saveTags() {
    setGlobal({tagModalOpen: false})
    ToastsStore.success(`Saving tags...`)
    let singleDoc = getGlobal().singleDoc;
    singleDoc["singleDocTags"] = getGlobal().singleDocTags;
    //Save the single Doc first
    try {
        let file = `/documents/${singleDoc.id}.json`
        let singleDocParams = {
            fileName: file, 
            body: JSON.stringify(singleDoc), 
            encrypt: true
        }
        let updatedSingleDoc = await postData(singleDocParams)
        console.log(updatedSingleDoc)
    } catch(error) {
        console.log(error)
    }
    //Then update the doc collection and save it
github Graphite-Docs / graphite / src / components / forms / helpers / singleForm.js View on Github external
export async function loadForm(id, refresh) {
    let fetchedKeys;
    const { userSession } = getGlobal();
    let teamForm = window.location.href.includes('team') ? true : false;
    if(refresh === false) {
        setGlobal({ formLoading: false });
        ToastsStore.success(`Fetching new responses...`);
    } else {
        setGlobal({ formLoading: true });
    }
    
    if(teamForm) {
        const teamId = window.location.href.split('team/')[1].split('/')[0];
        //Need to load the team form info first, then we can figure out which bucket to load from.
        //Fetch teamKeys
        const teamKeyParams = {
            fileName: `user/${userSession.loadUserData().username.split('.').join('_')}/team/${teamId}/key.json`,
            decrypt: true,
        }
        fetchedKeys = await fetchData(teamKeyParams);
        setGlobal({ teamKeys: fetchedKeys });
        const data = {
            profile: userSession.loadUserData().profile,
github Graphite-Docs / graphite / src / components / forms / helpers / singleForm.js View on Github external
fileName: 'forms.json',
                encrypt: true,
                body: JSON.stringify(getGlobal().forms)
            }
            const newIndex = await postData(newFormIndex);
            console.log(newIndex);
            ToastsStore.success(`Form saved`);
        } else {
            console.log("Error form index");
            ToastsStore.error(`Trouble saving form`);
        }
    }

    const newForm = await postData(newFormParams);

    ToastsStore.success(`Form saved`);
    console.log(newForm);
}

react-toasts

Simple react alerter.

ISC
Latest version published 5 years ago

Package Health Score

48 / 100
Full package analysis

Popular react-toasts functions