Skip to content

Commit 552127d

Browse files
committed
update models
1 parent f7800ed commit 552127d

18 files changed

Lines changed: 865 additions & 1965 deletions

File tree

.gitignore

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,8 @@ node_modules
1313
dist
1414
dist-ssr
1515
*.local
16+
.env.submit
17+
scripts/chrome-web-store.json
1618

1719
# Editor directories and files
1820
!.vscode/extensions.json

package.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
{
22
"name": "silo",
33
"private": true,
4-
"version": "1.8.17",
4+
"version": "1.8.18",
55
"type": "module",
66
"scripts": {
77
"dev": "vite",
@@ -74,4 +74,4 @@
7474
"@wxt-dev/storage": "1.2.0"
7575
}
7676
}
77-
}
77+
}

src/components/Header/MobileModelSelector/index.jsx

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -48,9 +48,9 @@ const MobileModelSelector = forwardRef((props, ref) => {
4848
filter: model => model.vision,
4949
},
5050
{
51-
value: 'free',
52-
label: 'Free',
53-
filter: model => model.price <= 0,
51+
value: 'gift',
52+
label: 'Gift',
53+
filter: model => model.supportsGift,
5454
},
5555
];
5656

src/components/ModelOption.jsx

Lines changed: 22 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,9 @@ export default function ModelOption({ option }) {
1616
const { t } = useTranslation();
1717
const [userInfo] = useUserInfo();
1818
const { category } = userInfo;
19+
const hasKnownPrice = typeof option.price === 'number';
20+
const hasInputOutputPrice =
21+
typeof option.priceIn === 'number' && typeof option.priceOut === 'number';
1922

2023
return (
2124
<div className="flex flex-col">
@@ -63,27 +66,40 @@ export default function ModelOption({ option }) {
6366
TPM: {fmtNumber(option.levels[category].TPM)}
6467
</Tag>
6568
)}
66-
{option.price > 0 ? (
69+
{!!option.supportsGift && (
6770
<Tag
6871
className="ml-2 inline-flex items-center justify-center"
6972
variant="outline"
7073
size="small"
71-
theme={option.noGift ? 'danger' : 'success'}
74+
theme="success"
75+
icon={<i className="iconify i-mingcute-gift-card-fill"></i>}
76+
>
77+
<span className="pl-1">{t('common.gift', 'Gift')}</span>
78+
</Tag>
79+
)}
80+
{hasKnownPrice && option.price > 0 ? (
81+
<Tag
82+
className="ml-2 inline-flex items-center justify-center"
83+
variant="outline"
84+
size="small"
85+
theme="warning"
7286
icon={<i className="iconify i-mingcute-currency-dollar-fill"></i>}
7387
>
7488
<div className="pl-1">
75-
{option.priceIn === option.priceOut ? (
89+
{hasInputOutputPrice && option.priceIn === option.priceOut ? (
7690
<span>{option.priceIn}</span>
77-
) : (
91+
) : hasInputOutputPrice ? (
7892
<>
7993
<span>{option.priceIn}</span>
8094
<span className="mx-0.5">/</span>
8195
<span>{option.priceOut}</span>
8296
</>
97+
) : (
98+
<span>{option.price}</span>
8399
)}
84100
</div>
85101
</Tag>
86-
) : (
102+
) : hasKnownPrice && option.price === 0 ? (
87103
<Tag
88104
className="ml-2 inline-flex items-center justify-center"
89105
variant="outline"
@@ -92,7 +108,7 @@ export default function ModelOption({ option }) {
92108
>
93109
{t('common.free')}
94110
</Tag>
95-
)}
111+
) : null}
96112

97113
{/* {option.isVendorA && (
98114
<Tag size="small" variant="outline" theme="success" className="ml-2">

0 commit comments

Comments
 (0)