-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: add whatsapp share button close #15
- Loading branch information
1 parent
1cb19e1
commit 2032e70
Showing
8 changed files
with
81 additions
and
35 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
import type { LoaderSubmission } from '@remix-run/react/transition'; | ||
import { redirect } from '@remix-run/node'; | ||
import type { Phrase as PhraseType } from '~/tyles/phrase'; | ||
import { loaderPhrase } from '~/loaders/phrase'; | ||
|
||
export async function loader(submission: LoaderSubmission) { | ||
const { phrase, author, path } = await loaderPhrase<PhraseType>(submission); | ||
if (!phrase) return redirect(`/`); | ||
|
||
const BASE_URL = process.env.SITE_BASE_URL || 'https://motivaai.nandomoreira.dev'; | ||
const text = encodeURIComponent(`_“${phrase}”_ ⏤ ${author} \nconfira em: ${BASE_URL}/${path}`); | ||
const url = 'https://api.whatsapp.com/send'; | ||
|
||
return redirect(`${url}?text=${text}`); | ||
} | ||
|
||
export default function Index() { | ||
return <></>; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
2032e70
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Successfully deployed to the following URLs:
motivaai – ./
motivaai-nandomoreira.vercel.app
motivaai-nuxt.vercel.app
motivaai.nandomoreira.me
motivaai.nandomoreira.dev
motivaai-git-develop-nandomoreira.vercel.app
motivaai-nuxt.nandomoreira.vercel.app