Skip to content
Merged
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
4 changes: 3 additions & 1 deletion app/public/locales/en/translation.json
Original file line number Diff line number Diff line change
Expand Up @@ -710,7 +710,9 @@
"crnt12": "Communicating with emoji reactions is so smooth!",
"crnt13": "Even if the server I’m on shuts down, <br/> I can easily move my relationships to a new server, so no worries!",
"crnt14": "I’m hungry YO",
"crnt_totegamma": "This is exactly it!"
"crnt_totegamma": "This is exactly it!",
"v2NoticeTitle": "Create your account on the Concrnt v2 app",
"v2NoticeDescription": "Concrnt is migrating to v2, and new registrations on this site (v1) have closed. Scan the QR code below with your smartphone to get the app and create an account there. You can still log in to existing accounts here."
},
"mock": {
"home": {
Expand Down
4 changes: 3 additions & 1 deletion app/public/locales/ja/translation.json
Original file line number Diff line number Diff line change
Expand Up @@ -709,7 +709,9 @@
"crnt12": "絵文字リアクションでのコミュニケーションが快適!",
"crnt13": "いまいるサーバーが閉鎖しちゃっても、<br/>関係をそのまま引っ越せるから安心!",
"crnt14": "おなかすいたYO",
"crnt_totegamma": "こういうの、あれ!"
"crnt_totegamma": "こういうの、あれ!",
"v2NoticeTitle": "新規アカウント作成はConcrnt v2アプリで",
"v2NoticeDescription": "Concrntは現在v2への移行期間中のため、このサイト(v1)での新規登録は終了しました。お使いのスマートフォンで下のQRコードを読み取り、アプリからアカウントを作成してください。既存アカウントでのログインは引き続きこちらから可能です。"
},
"mock": {
"home": {
Expand Down
4 changes: 3 additions & 1 deletion app/public/locales/ko/translation.json
Original file line number Diff line number Diff line change
Expand Up @@ -268,7 +268,9 @@
"item4": "- 다른 유저의 활동 타임라인(Timelines of Other Users' Activities)",
"item5": "- 기타 등등..."
}
}
},
"v2NoticeTitle": "새 계정은 Concrnt v2 앱에서 만들어 주세요",
"v2NoticeDescription": "Concrnt는 현재 v2로 이행 중이며, 이 사이트(v1)에서의 신규 가입은 종료되었습니다. 스마트폰으로 아래 QR 코드를 스캔하여 앱을 설치하고 계정을 만들어 주세요. 기존 계정 로그인은 계속 이용할 수 있습니다."
},
"registration": {
"welcome": {
Expand Down
4 changes: 3 additions & 1 deletion app/public/locales/th/translation.json
Original file line number Diff line number Diff line change
Expand Up @@ -201,7 +201,9 @@
"item4": "- Timelines of Other Users' Activities",
"item5": "- etc..."
}
}
},
"v2NoticeTitle": "สร้างบัญชีใหม่ได้ที่แอป Concrnt v2",
"v2NoticeDescription": "Concrnt กำลังย้ายไปยัง v2 การสมัครสมาชิกใหม่บนเว็บไซต์นี้ (v1) จึงสิ้นสุดลงแล้ว โปรดสแกน QR โค้ดด้านล่างด้วยสมาร์ตโฟนเพื่อดาวน์โหลดแอปและสร้างบัญชี ส่วนการเข้าสู่ระบบด้วยบัญชีเดิมยังใช้งานได้ตามปกติ"
},
"registration": {
"welcome": {
Expand Down
4 changes: 3 additions & 1 deletion app/public/locales/zh-Hans/translation.json
Original file line number Diff line number Diff line change
Expand Up @@ -707,7 +707,9 @@
"crnt12": "用表情反应交流真是顺畅!",
"crnt13": "即使我所在的服务器关闭了,<br/> 我也可以轻松将关系转移到新服务器,所以不用担心!",
"crnt14": "饿了 YO",
"crnt_totegamma": "就是这个!"
"crnt_totegamma": "就是这个!",
"v2NoticeTitle": "请在 Concrnt v2 应用中创建新账号",
"v2NoticeDescription": "Concrnt 正在迁移至 v2,本站(v1)的新用户注册已经停止。请用智能手机扫描下方二维码获取应用并在其中创建账号。已有账号仍可继续在此登录。"
},
"mock": {
"home": {
Expand Down
4 changes: 3 additions & 1 deletion app/public/locales/zh-Hant/translation.json
Original file line number Diff line number Diff line change
Expand Up @@ -707,7 +707,9 @@
"crnt12": "用表情符號回應來交流真是太順暢了!",
"crnt13": "即使我所在的伺服器關閉了,<br/> 我也可以輕鬆地將我的關係轉移到新伺服器,所以不用擔心!",
"crnt14": "我餓了 YO",
"crnt_totegamma": "就是這個!"
"crnt_totegamma": "就是這個!",
"v2NoticeTitle": "請在 Concrnt v2 應用程式中建立新帳號",
"v2NoticeDescription": "Concrnt 正在遷移至 v2,本站(v1)的新用戶註冊已經停止。請用智慧型手機掃描下方 QR code 取得應用程式並在其中建立帳號。既有帳號仍可繼續在此登入。"
},
"mock": {
"home": {
Expand Down
75 changes: 1 addition & 74 deletions app/src/components/Settings/General.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@ import {
AccordionActions,
AccordionDetails,
AccordionSummary,
Alert,
Box,
Button,
Checkbox,
Expand All @@ -27,7 +26,7 @@ import { usePreference } from '../../context/PreferenceContext'
import { useClient } from '../../context/ClientContext'
import { useEffect, useState } from 'react'
import { useSnackbar } from 'notistack'
import { CommunityTimelineSchema, Schemas, Timeline } from '@concrnt/worldlib'
import { Schemas } from '@concrnt/worldlib'
import { useTranslation } from 'react-i18next'
import { type NotificationSubscription } from '../../model'
import ExpandMoreIcon from '@mui/icons-material/ExpandMore'
Expand All @@ -37,7 +36,6 @@ import TextDecreaseIcon from '@mui/icons-material/TextDecrease'
import DeleteIcon from '@mui/icons-material/Delete'
import { CCIconButton } from '../ui/CCIconButton'
import { ListItemTimeline } from '../ui/ListItemTimeline'
import { TimelineSelector } from '../ui/TimelineSelector'

export const GeneralSettings = (): JSX.Element => {
const { client } = useClient()
Expand All @@ -52,8 +50,6 @@ export const GeneralSettings = (): JSX.Element => {
const [autoSwitchMediaPostType, setAutoSwitchMediaPostType] = usePreference('autoSwitchMediaPostType')
const [tutorialCompleted, setTutorialCompleted] = usePreference('tutorialCompleted')
const [baseFontSize, setBaseFontSize] = usePreference('baseFontSize')
const [inviteComment, setInviteComment] = useState<string>('')
const [preferredTimeline, setPreferredTimeline] = useState<Timeline<CommunityTimelineSchema> | undefined>(undefined)

const { enqueueSnackbar } = useSnackbar()

Expand Down Expand Up @@ -656,75 +652,6 @@ export const GeneralSettings = (): JSX.Element => {
</DialogActions>
</Dialog>
</Box>
<Accordion disableGutters>
<AccordionSummary expandIcon={<ExpandMoreIcon />}>
<Typography variant="h4">{t('invitation')}</Typography>
</AccordionSummary>
<AccordionDetails>
{domainInfo?.meta?.registration == 'invite' && (
<Alert severity="info" sx={{ marginBottom: 2 }}>
{t('inviteNote')}
</Alert>
)}
<Box
sx={{
display: 'flex',
flexDirection: 'column',
gap: 2
}}
>
<TextField
fullWidth
label={t('inviteComment')}
value={inviteComment}
onChange={(e) => {
setInviteComment(e.target.value)
}}
placeholder={'welcome'}
/>
<TimelineSelector
label={t('inviteTimeline')}
selected={preferredTimeline}
setSelected={setPreferredTimeline}
/>
</Box>
<Box
sx={{
display: 'flex',
gap: 1,
justifyContent: 'flex-end',
marginTop: 2
}}
>
<Button
onClick={(_) => {
if (client.host === undefined) {
return
}

let link = `${window.location.origin}/invitation#inviter=${client.ccid}&domain=${client.host}`
if (inviteComment) link += `&comment=${encodeURIComponent(inviteComment)}`
if (preferredTimeline) link += `&timeline=${preferredTimeline.id}`
if (domainInfo?.meta?.registration == 'invite') {
const jwt = client.api.authProvider.issueJWT({
aud: client.host,
sub: 'CONCRNT_INVITE',
exp: Math.floor(
(new Date().getTime() + 14 * 24 * 60 * 60 * 1000) / 1000
).toString()
})
link += `&ticket=${jwt}`
}

navigator.clipboard.writeText(link)
enqueueSnackbar(t('copied'), { variant: 'success' })
}}
>
{t('copyInviteLink')}
</Button>
</Box>
</AccordionDetails>
</Accordion>
</Box>
)
}
108 changes: 108 additions & 0 deletions app/src/components/welcome/AppStoreQR.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,108 @@
import Box from '@mui/material/Box'
import { Paper, Typography, alpha, useTheme } from '@mui/material'
import { QRCode } from 'react-qrcode-logo'
import { useTranslation } from 'react-i18next'
import SmartphoneIcon from '@mui/icons-material/Smartphone'
import appStoreBadge from '../../resources/appstore-badge.svg'
import googlePlayBadge from '../../resources/googleplay-badge.png'

const stores = [
{
label: 'Download on the App Store',
badge: appStoreBadge,
url: 'https://apps.apple.com/jp/app/concrnt-world/id6757524249'
},
{
label: 'Get it on Google Play',
badge: googlePlayBadge,
url: 'https://play.google.com/store/apps/details?id=world.concrnt.app'
}
]

export default function AppStoreQR(): JSX.Element {
const { t } = useTranslation('', { keyPrefix: 'welcome' })
const theme = useTheme()

return (
<Paper
variant="outlined"
sx={{
display: 'flex',
flexDirection: 'column',
gap: 2,
p: 3,
maxWidth: '600px',
width: '100%',
zIndex: 1,
backdropFilter: 'blur(2px)',
backgroundColor: alpha(theme.palette.background.paper, 0.8)
}}
>
<Box display="flex" alignItems="flex-start" gap={2}>
<Box
sx={{
width: '42px',
height: '42px',
borderRadius: 1,
backgroundColor: alpha(theme.palette.primary.main, 0.14),
color: 'primary.main',
display: 'flex',
alignItems: 'center',
justifyContent: 'center',
flexShrink: 0
}}
>
<SmartphoneIcon />
</Box>
<Box display="flex" flexDirection="column" gap={1}>
<Typography fontWeight={700}>{t('v2NoticeTitle')}</Typography>
<Typography variant="body2" sx={{ opacity: 0.8 }}>
{t('v2NoticeDescription')}
</Typography>
</Box>
</Box>
<Box display="flex" justifyContent="center" gap={3} flexWrap="wrap">
{stores.map((store) => (
<Box
key={store.label}
component="a"
href={store.url}
target="_blank"
rel="noopener noreferrer"
sx={{
display: 'flex',
flexDirection: 'column',
alignItems: 'center',
gap: 1.5,
textDecoration: 'none'
}}
>
<Box
sx={{
padding: '8px',
borderRadius: 1,
backgroundColor: '#ffffff',
display: 'flex',
alignItems: 'center',
justifyContent: 'center'
}}
>
<QRCode
value={store.url}
size={288}
ecLevel="M"
quietZone={0}
style={{ width: '144px', height: '144px' }}
fgColor="#000000"
bgColor="#ffffff"
qrStyle="squares"
eyeRadius={0}
/>
</Box>
<img src={store.badge} alt={store.label} style={{ height: '40px', width: 'auto' }} />
</Box>
))}
</Box>
</Paper>
)
}
30 changes: 3 additions & 27 deletions app/src/main.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -19,8 +19,6 @@ import { PrivacyPolicy } from './pages/PrivacyPolicy'

const AppPage = lazy(() => import('./App'))
const Welcome = lazy(() => import('./pages/Welcome'))
const Invitation = lazy(() => import('./pages/Invitation'))
const Registration = lazy(() => import('./pages/Registration'))
const AccountImport = lazy(() => import('./pages/AccountImport'))
const GuestTimelinePage = lazy(() => import('./pages/GuestTimeline'))
const GuestMessagePage = lazy(() => import('./pages/GuestMessage'))
Expand Down Expand Up @@ -84,31 +82,9 @@ ReactDOM.createRoot(document.getElementById('root') as HTMLElement).render(
</ClientProvider>
}
/>
{!logined ? (
<>
<Route
path="/register"
element={
<GA4Provider tag={tag}>
<Registration />
</GA4Provider>
}
/>
<Route
path="/invitation"
element={
<GA4Provider tag={tag}>
<Invitation />
</GA4Provider>
}
/>
</>
) : (
<>
<Route path="/register" element={<Navigate to="/" />} />
<Route path="/invitation" element={<Navigate to="/" />} />
</>
)}
{/* v1の新規登録は停止済み。アカウント作成はv2(world-app)へ誘導する */}
<Route path="/register" element={<Navigate to={logined ? '/' : '/welcome'} />} />
<Route path="/invitation" element={<Navigate to={logined ? '/' : '/welcome'} />} />
<Route
path="/import"
element={
Expand Down
2 changes: 1 addition & 1 deletion app/src/pages/AccountImport.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ export default function AccountImport(): JSX.Element {
gap: 2
}}
additionalButton={
<Button component={Link} to="/register">
<Button component={Link} to="/welcome">
{t('getStarted')}
</Button>
}
Expand Down
2 changes: 1 addition & 1 deletion app/src/pages/GuestMessage.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -111,7 +111,7 @@ export default function GuestMessagePage(): JSX.Element {
flex: 1
}}
additionalButton={
<Button component={NavLink} to="/register">
<Button component={NavLink} to="/welcome">
{t('getStarted')}
</Button>
}
Expand Down
2 changes: 1 addition & 1 deletion app/src/pages/GuestProfile.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -96,7 +96,7 @@ export default function GuestProfilePage(): JSX.Element {
flex: 1
}}
additionalButton={
<Button component={NavLink} to="/register">
<Button component={NavLink} to="/welcome">
{t('getStarted')}
</Button>
}
Expand Down
8 changes: 1 addition & 7 deletions app/src/pages/GuestTimeline.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -66,13 +66,7 @@ export default function GuestTimelinePage(): JSX.Element {
flex: 1
}}
additionalButton={
<Button
component={NavLink}
to="/register"
onClick={() => {
if (id) localStorage.setItem('preferredTimeline', id)
}}
>
<Button component={NavLink} to="/welcome">
{t('getStarted')}
</Button>
}
Expand Down
Loading
Loading