Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
71 changes: 71 additions & 0 deletions .swm/initial-attempt.byxk7.sw.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,71 @@
---
id: byxk7
name: Initial attempt
file_version: 1.0.2
app_version: 0.7.0-1
file_blobs:
src/components/OneLinkForm.jsx: 96a070938c45ecb733073030501e04707e010c82
---

In the function `generateURL` there are several things that are done.
Testing 1

2

3

<br/>

`📄 src/components/OneLinkForm.jsx`
<!-- NOTE-swimm-snippet: the lines below link your snippet to Swimm -->
### 📄 src/components/OneLinkForm.jsx
```javascript
⬜ 72 generateShortURL()
⬜ 73 }
⬜ 74
🟩 75 const generateURL = async () => {
🟩 76 let url = "https://onelink-sim.onelink.me/coiD"
🟩 77 let pid = "QR_code"
🟩 78
🟩 79 if (!deepLinkState) {
🟩 80 url = "https://onelink-sim.onelink.me/P3Ik"
🟩 81 pid = "QR_code_broken"
🟩 82 }
🟩 83
🟩 84 const params = {
🟩 85 deep_link_value: selectedPage || undefined,
🟩 86 deep_link_sub1: fruitAmount?.value || undefined,
🟩 87 af_ios_url:
🟩 88 iOSRedirect.label === "Web Page" ? iOSRedirect.value : undefined,
🟩 89 af_android_url:
🟩 90 androidRedirect.label === "Web Page"
🟩 91 ? androidRedirect.value
🟩 92 : undefined,
🟩 93 af_web_dp: webRedirect.value || undefined,
🟩 94 }
🟩 95
🟩 96 const query = querystring.stringify(params)
🟩 97 const finalURL = `${url}?pid=${pid}&${query}`
🟩 98
🟩 99 await setOneLinkURL(finalURL)
🟩 100 const isMobile = window.innerWidth < 768
🟩 101
🟩 102 if (isMobile) {
🟩 103 qrCodeRef.current?.scrollIntoView({ behavior: "smooth" })
🟩 104 }
🟩 105
🟩 106 gaTag.event({
🟩 107 category: 'User',
🟩 108 action: 'Link Generated',
🟩 109 label: selectedPage,
🟩 110 value: parseInt(fruitAmount.value)
🟩 111 });
🟩 112 }
⬜ 113
⬜ 114 const generateShortURL = async () => {
⬜ 115 const options = {
```

<br/>

This file was generated by Swimm. [Click here to view it in the app](https://app.swimm.io/repos/Z2l0aHViJTNBJTNBZGVlcC1saW5raW5nLXNpbXVsYXRvci1kZXYlM0ElM0FjaGF5ZXY=/docs/byxk7).
6 changes: 6 additions & 0 deletions .swm/swimm.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
{
"repo_id": "Z2l0aHViJTNBJTNBZGVlcC1saW5raW5nLXNpbXVsYXRvci1kZXYlM0ElM0FjaGF5ZXY=",
"configuration": {
"swmd": true
}
}