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

fix interaction with android #38

Merged
merged 83 commits into from
Aug 7, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
83 commits
Select commit Hold shift + click to select a range
274c9cc
feat(apps/onboarding): setup svgr (#17)
manudeli Jul 1, 2023
e0fc829
feat(apps/onboarding): add openapi-generator (#16)
manudeli Jul 6, 2023
7969931
Feature/alcohol resister result page UI (#15)
deli-ght Jul 10, 2023
bf83c90
feat(api): attach apis (#19)
deli-ght Jul 15, 2023
4f6dec9
chore(asset): refactor assets
deli-ght Jul 15, 2023
152fa12
feat(onboarding): og image, metadata in emotion env
manudeli Jul 18, 2023
3035391
fix(onboarding): resolve RSC
manudeli Jul 18, 2023
6c50a3a
chore(pnpm): add pnpm stripts
deli-ght Jul 22, 2023
64ee33b
fix(Button): fix use Button as lib
deli-ght Jul 22, 2023
ee7f5dd
fix(Button): fix to apply style of button token
deli-ght Jul 22, 2023
6e292b0
style(result): apply removed styles
deli-ght Jul 22, 2023
8622a31
fix(pseudo-elements): fix seperated border issue
deli-ght Jul 22, 2023
02bf73e
Feat/apply dynamic metadata (#22)
deli-ght Jul 22, 2023
f4b6093
fix(metadata): remove parents image
deli-ght Jul 22, 2023
f58754d
fix(metadata): remove async
deli-ght Jul 22, 2023
0ef0728
fix: update next version
manudeli Jul 22, 2023
b813ee3
fix(metadata): remove env
deli-ght Jul 22, 2023
55969c6
Merge branch 'develop' of https://github.com/mash-up-kr/sulsul-web in…
deli-ght Jul 22, 2023
eb4ca31
fix: packages/ui, searchParams of next
manudeli Jul 22, 2023
e87cba7
fix: remove suspense
manudeli Jul 22, 2023
aa4070d
Merge branch 'develop' of https://github.com/mash-up-kr/sulsul-web in…
deli-ght Jul 22, 2023
8760f02
refactor(dynamic): remove dynamic
deli-ght Jul 22, 2023
fb67b71
fix(metadata): add metadata base
deli-ght Jul 22, 2023
5b48433
fix(metadata): add config
deli-ght Jul 22, 2023
4c26fb8
Feature/main page (#26)
deli-ght Jul 23, 2023
0e78399
refactor(onboarding): change directory
manudeli Jul 23, 2023
82c12e5
fix(onboarding): change url to svgr for no fetch image
manudeli Jul 23, 2023
37935a0
feat(onboarding): add initial MeasurePage (#27)
manudeli Jul 23, 2023
45e5736
fix(onboarding): update measure style
manudeli Jul 23, 2023
4e0ee7c
Feature/matter UI (#28)
deli-ght Jul 24, 2023
2fabbcc
fix(onboarding/measure): reduce width
manudeli Jul 25, 2023
2a1e009
Init test for android (#29)
deli-ght Jul 25, 2023
5e08d7f
feat(assets): add assets for test
deli-ght Jul 25, 2023
08ba5cf
feat(falling): add count for test
deli-ght Jul 25, 2023
7b1253b
feat(falling): add event
deli-ght Jul 25, 2023
304415b
feat(falling): add message
deli-ght Jul 25, 2023
5d348f7
feat(falling): add add event
deli-ght Jul 25, 2023
ffb4aff
refactor(falling): remove function
deli-ght Jul 25, 2023
b526b55
feat: guarantee webview
manudeli Jul 25, 2023
badc0d4
feat(event): change event name
deli-ght Jul 27, 2023
4e4013d
fix(webview): check webview is ready
deli-ght Jul 27, 2023
fabfb57
feat(test): add state for test
deli-ght Jul 27, 2023
203c569
fix(falling): fix build errors
deli-ght Jul 27, 2023
cb9a031
feat(falling): apply drink type
deli-ght Jul 27, 2023
203b53c
feat(falling): add default value
deli-ght Jul 27, 2023
1c5a71b
feat(falling): apply details
deli-ght Jul 27, 2023
6195f04
feat(onboading): add router for result
deli-ght Jul 29, 2023
50bd4f2
style(onboarding): add button hover style
deli-ght Jul 29, 2023
03b508f
refactor(onboarding): add suspense
deli-ght Jul 29, 2023
53ac5f2
feat(onboarding): apply favicon
deli-ght Jul 29, 2023
d548981
fix(onboarding): move site webmanifest
deli-ght Jul 29, 2023
63c3390
chore(image): change image
deli-ght Jul 29, 2023
811a213
feat(onboarding): update style drinkTypeSelector
manudeli Jul 29, 2023
ae85606
Feature/check android (#32)
deli-ght Jul 29, 2023
9980e1a
Revert "Feature/check android" (#34)
manudeli Jul 29, 2023
44fd145
Feature/check android (#35)
deli-ght Jul 29, 2023
3917b38
Merge branch 'develop' of https://github.com/mash-up-kr/sulsul-web in…
deli-ght Jul 29, 2023
143a585
feat(falling): check first event
deli-ght Jul 29, 2023
b35e9a7
feat(falling): add android event
deli-ght Jul 29, 2023
b7498f9
fix(measure): resolve error
manudeli Jul 29, 2023
894a74f
feat(onboarding): seperate action for android
deli-ght Jul 29, 2023
299290e
fix(falling): fix bug
deli-ght Jul 29, 2023
69f18e8
feat(StackView): add removeBall last item
manudeli Jul 29, 2023
00c9ed0
fix(onboarding/measure): divide circleGradientsCss from section
manudeli Jul 29, 2023
7d34d30
Merge branch 'develop' of https://github.com/mash-up-kr/sulsul-web in…
deli-ght Jul 29, 2023
8f4d81a
fix(falling): fix first touch error
deli-ght Jul 29, 2023
ecc18ba
feat(onboading): add loading
deli-ght Jul 29, 2023
702419a
chore(runtime): fix runtime method
deli-ght Jul 29, 2023
b462470
fix(onboarding): style result
manudeli Jul 29, 2023
5d5dca8
fix(onboarding, measure): choose only one drinkType
manudeli Jul 29, 2023
67d1244
chore(api): update api spec
manudeli Jul 29, 2023
a5ef473
feat(api): update api
deli-ght Aug 3, 2023
164e2ba
style(result): add scroll animation
deli-ght Aug 3, 2023
9228bd6
fix(result): fix type with result api
deli-ght Aug 3, 2023
6c1b4c9
style(onboarding): fix style
deli-ght Aug 6, 2023
ca362d1
style(onboarding): change details
deli-ght Aug 6, 2023
0a0d06a
Merge branch 'main' into develop
deli-ght Aug 7, 2023
4243f12
fix(lint): fix lint
deli-ght Aug 7, 2023
d881121
style(onboarding): add style
deli-ght Aug 7, 2023
1294111
feat(deeplink): add deep link
deli-ght Aug 7, 2023
80f413b
feat(link): add link
deli-ght Aug 7, 2023
e34f6fe
Merge branch 'main' into develop
deli-ght Aug 7, 2023
0c846f4
fix(onboarding): fix ref unfound
deli-ght Aug 7, 2023
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
1 change: 1 addition & 0 deletions apps/onboarding/src/app/measure/page.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -82,6 +82,7 @@ export default function MeasurePage() {
bottom: 0;
background: url('/svgs/grainy.svg') repeat, #1f2229;
background-size: contain;
padding-top: 50px;
`}
>
<Box
Expand Down
1 change: 1 addition & 0 deletions apps/onboarding/src/app/page.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,7 @@ export default function Home() {
background: '#1f2229',
padding: '100px 0 32px',
textAlign: 'center',
minHeight: '100vh',
}}
>
<div
Expand Down
32 changes: 29 additions & 3 deletions apps/onboarding/src/app/result/components/ResultContents.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ import { Button } from '@sulsul/ui';
import { DrinkReq, TitleDto, TitleDtoTitleEnum } from '~/api';
import { AlcoholDetails, AlcoholResultDetails } from '~/constants/alcohol';
import { ResultCard } from './ResultCard';
import { useSearchParams } from 'next/navigation';
import { useRouter, useSearchParams } from 'next/navigation';
import axios from 'axios';
import { css } from '@emotion/react';
import { shareResult } from '~/app/utils/share';
Expand Down Expand Up @@ -72,12 +72,14 @@ const Volumn = styled.p`
`;

export const ResultContents = () => {
const router = useRouter();
const searchParams = useSearchParams();
const drinkType = searchParams?.get('drinkType');
const glasses = Number(searchParams?.get('glasses'));
const baseY = useMotionValue(0);
const backgroundRef = useRef<HTMLDivElement>(null);
const scrollHeight = backgroundRef.current?.scrollHeight ?? 0;
const scrollHeight = backgroundRef.current?.scrollHeight ?? 200;

const opacityOfY = useTransform(
baseY,
(v) => `${Math.max((v / scrollHeight) * 100, 30)}`
Expand Down Expand Up @@ -106,6 +108,30 @@ export const ResultContents = () => {
const resultSubTitle = resultTitleData?.subTitle;
const { svg, mainColor, color1, color2 } = AlcoholResultDetails[resultTitle];

const measureInApp = () => {
if (globalThis?.window.sulsulBridge) {
globalThis.window.sulsulBridge.onStartMeasureDrink();
return;
}

const checkAndroid = () => {
const u = navigator.userAgent;
return !!u.match(/Android/i);
};

if (checkAndroid()) {
const deep_link =
'intent://measuring/#Intent;scheme=sulsul;package=com.mashup.alcoholfree;end';

router.push(deep_link);
return;
}

router.push(
'https://play.google.com/store/apps/details?id=com.mashup.alcoholfree&hl=en-KR'
);
};

return (
<Stack.Vertical
color="white"
Expand Down Expand Up @@ -257,7 +283,7 @@ export const ResultContents = () => {
<Button type="button" onClick={shareResult} size="lg">
내 주량 공유하기
</Button>
<Button type="button" appearance="primary" size="lg">
<Button type="button" appearance="primary" size="lg" onClick={measureInApp}>
술자리에서 측정하기
</Button>
</Stack.Vertical>
Expand Down