Compare commits

...

20 Commits

Author SHA1 Message Date
Arik Chakma
3eef8c7a0b fix: add to the body 2024-06-07 02:41:13 +06:00
Arik Chakma
de54e7d8f8 Merge branch 'master' into feat/mobile 2024-06-07 02:14:42 +06:00
Arik Chakma
5b87465b5a feat: implement mobile impressions 2024-06-07 02:12:24 +06:00
Arik Chakma
b88304e238 feat: implement topic link's label (#5817) 2024-06-06 19:01:05 +01:00
Arik Chakma
4d7a0f5d06 fix: return response status code (#5815) 2024-06-06 15:34:54 +01:00
Liliana Santos
1cc34e61c4 Update 104-reference-vars.md (#5775) 2024-06-06 09:42:52 +01:00
Archit Sharma
5a19b890a9 Added video resources for React Components (#5810)
Signed-off-by: Archit Sharma <74408634+iArchitSharma@users.noreply.github.com>
2024-06-05 18:48:57 +01:00
Liliana Santos
df17366517 Update Property Binding to most recent link (#5774)
Update 101-property-binding.md
2024-06-04 11:26:53 +01:00
Sion Kang
5648b14764 Update ci-cd.md (#5807) 2024-06-04 09:40:22 +01:00
Ruslan Semagin
6076e8e8b5 add links for 'grep' (#5808) 2024-06-04 09:39:59 +01:00
Ruslan Semagin
1a351e3aeb add links for 'awk' (#5801) 2024-06-03 14:24:41 +01:00
Ruslan Semagin
4a71075340 feat: change the description and links in the 'log/slog' node (#5798)
* change the description and links in the 'log/slog' node
---------

Co-authored-by: dsh <daniel.s.holdsworth@gmail.com>
2024-06-03 10:27:45 +01:00
dsh
7c60b8cfea fix broken go topic (#5800) 2024-06-03 10:15:44 +01:00
Ruslan Semagin
128582fa40 add links to the 'Modules and Crates' node in the Rust roadmap (#5797) 2024-06-03 09:57:10 +01:00
Juan Gerardo Eulufi Salazar
27c3fcdb40 Add reference link to React Native ImageBackground component (#5795)
* add reference link to React Native ImageBackground component

---------

Co-authored-by: Ruslan Semagin <pixel.365.24@gmail.com>
Co-authored-by: dsh <daniel.s.holdsworth@gmail.com>
Co-authored-by: Ruslan Semagin <53819609+pixel365@users.noreply.github.com>
Co-authored-by: Suman Kisku <sumankisku1@gmail.com>
2024-06-03 09:54:55 +01:00
Anthony Pun
6b552b584a Fix: Standardize using "docker container ls" command when referencing listing containers (#5787) 2024-06-02 19:53:45 +01:00
Yash Deore
1b9628f826 Patch 1 (#5792)
Update 120-real-time-data.md (#5782)

Add links to pages containing brief explanations on the topics listed here.

Update well-architected framework.

---------

Co-authored-by: devgru-3-2 <95485002+devgru-3-2@users.noreply.github.com>
Co-authored-by: Danrley Senegalha Pires <dan.osp@outlook.com>
2024-06-02 19:51:18 +01:00
Ruslan Semagin
0aa093b031 feat: add links about testing in Rust (#5791) 2024-06-02 16:51:10 +01:00
Ruslan Semagin
b7e5d83105 feat: add useful links for Rust (#5781) 2024-05-31 15:36:12 +01:00
Juan Gerardo Eulufi Salazar
92996383cb add resource link for React Native Text component (#5773)
* add resource link for React Native Text component

---------

Co-authored-by: Ruslan Semagin <pixel.365.24@gmail.com>
Co-authored-by: dsh <daniel.s.holdsworth@gmail.com>
Co-authored-by: Ruslan Semagin <53819609+pixel365@users.noreply.github.com>
Co-authored-by: Suman Kisku <sumankisku1@gmail.com>
2024-05-31 10:53:17 +01:00
2 changed files with 37 additions and 2 deletions

View File

@@ -4,6 +4,7 @@ import { sponsorHidden } from '../stores/page';
import { useStore } from '@nanostores/react';
import { X } from 'lucide-react';
import { setViewSponsorCookie } from '../lib/jwt';
import { isMobile } from '../lib/is-mobile';
export type PageSponsorType = {
company: string;
@@ -50,6 +51,7 @@ export function PageSponsor(props: PageSponsorProps) {
`${import.meta.env.PUBLIC_API_URL}/v1-get-sponsor`,
{
href: window.location.pathname,
mobile: isMobile() ? 'true' : 'false',
},
);
@@ -75,9 +77,15 @@ export function PageSponsor(props: PageSponsorProps) {
};
const clickSponsor = async (sponsorId: string) => {
const { response, error } = await httpPatch<{ status: 'ok' }>(
const clickUrl = new URL(
`${import.meta.env.PUBLIC_API_URL}/v1-view-sponsor/${sponsorId}`,
{},
);
const { response, error } = await httpPatch<{ status: 'ok' }>(
clickUrl.toString(),
{
mobile: isMobile() ? true : false,
},
);
if (error || !response) {

27
src/lib/is-mobile.ts Normal file
View File

@@ -0,0 +1,27 @@
export function isAndroid(): boolean {
return (
typeof navigator !== 'undefined' && /android/i.test(navigator.userAgent)
);
}
export function isSmallIOS(): boolean {
return (
typeof navigator !== 'undefined' && /iPhone|iPod/.test(navigator.userAgent)
);
}
export function isLargeIOS(): boolean {
return (
typeof navigator !== 'undefined' &&
(/iPad/.test(navigator.userAgent) ||
(navigator.platform === 'MacIntel' && navigator.maxTouchPoints > 1))
);
}
export function isIOS(): boolean {
return isSmallIOS() || isLargeIOS();
}
export function isMobile(): boolean {
return isAndroid() || isIOS();
}