Skip to content

Commit

Permalink
fix: Issue with video upload (#1951)
Browse files Browse the repository at this point in the history
* Update Editor.tsx

* login fix

* fix video upload

* fix see more

* format fix

* lint fix
  • Loading branch information
RiXelanya authored Apr 26, 2024
1 parent 6386e19 commit 1871d50
Show file tree
Hide file tree
Showing 9 changed files with 19 additions and 27 deletions.
26 changes: 6 additions & 20 deletions src/components/Login/render/Options/Options.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -105,7 +105,6 @@ export const Options: React.FC<OptionProps> = props => {
() => ({
polkadot: <PolkadotNetworkIcon className={getMobileIconStyles} />,
sender: <SenderWalletDisabledIcon className={getMobileIconStyles} />,
near: <NearNetworkIcon className={getMobileIconStyles} />,
nova: <NovaDisableIcon className={getMobileIconStyles} />,
'my-near': <MyNearWalletIcon className={getMobileIconStyles} />,
}),
Expand All @@ -123,7 +122,7 @@ export const Options: React.FC<OptionProps> = props => {
return setSelectedWallet(WalletTypeEnum.POLKADOT)();
case BlockchainPlatform.NEAR:
console.log('test');
return setSelectedWallet(WalletTypeEnum.NEAR)();
return setSelectedWallet(WalletTypeEnum.MYNEAR)();
default:
return setWallet(null);
}
Expand All @@ -137,7 +136,6 @@ export const Options: React.FC<OptionProps> = props => {
break;

case WalletTypeEnum.MYNEAR:
case WalletTypeEnum.NEAR:
setWallet(value);
setExtensionChecked(true);
setExtensionEnabled(true);
Expand Down Expand Up @@ -372,7 +370,7 @@ export const Options: React.FC<OptionProps> = props => {
</ShowIf>
<ShowIf
condition={blockchainPlatform === BlockchainPlatform.NEAR}>
{[WalletTypeEnum.NEAR, WalletTypeEnum.MYNEAR].map(e => {
{[WalletTypeEnum.MYNEAR].map(e => {
return (
<Grid item xs={3} key={e}>
<ListItem
Expand All @@ -388,16 +386,8 @@ export const Options: React.FC<OptionProps> = props => {
: ''
}>
<div className={styles.card}>
{e === WalletTypeEnum.NEAR ? (
<NearNetworkIcon className={styles.icon} />
) : (
<MyNearWalletIcon className={styles.icon} />
)}
<Typography>
{e === WalletTypeEnum.NEAR
? 'NEAR Wallet'
: 'MyNearWallet'}
</Typography>
<MyNearWalletIcon className={styles.icon} />
<Typography>MyNearWallet</Typography>
</div>
</ListItem>
</Grid>
Expand Down Expand Up @@ -600,7 +590,7 @@ export const Options: React.FC<OptionProps> = props => {
classes={{ root: styles.list }}>
<ShowIf
condition={blockchainPlatform === BlockchainPlatform.NEAR}>
{[WalletTypeEnum.NEAR, WalletTypeEnum.MYNEAR].map(e => {
{[WalletTypeEnum.MYNEAR].map(e => {
return (
<Grid item xs={12} key={e}>
<ListItem
Expand All @@ -618,11 +608,7 @@ export const Options: React.FC<OptionProps> = props => {
}>
<div className={styles.rowCard}>
{walletIcons[e]}
<Typography>
{e === WalletTypeEnum.NEAR
? 'NEAR Wallet'
: 'MyNearWallet'}
</Typography>
<Typography>MyNearWallet</Typography>
</div>
</ListItem>
</Grid>
Expand Down
2 changes: 1 addition & 1 deletion src/components/common/CKEditor/MediaEmbedButton.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ export const MediaEmbedToolbarButton = ({
loading={progress > 0}
onFileSelected={handleFileSelected}
accept={['video/mp4', 'video/x-m4v', 'video/*']}
maxSize={100}
maxSize={210}
placeholder={i18n.t('Post_Create.Upload.Video.Placeholder')}
usage="post"
/>
Expand Down
2 changes: 1 addition & 1 deletion src/components/common/Editor/Editor.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -85,7 +85,7 @@ import { ListItemComponent } from 'src/components/atoms/ListItem';
import { User } from 'src/interfaces/user';
import * as UploadAPI from 'src/lib/api/upload';

const MAX_CHARACTER_LIMIT = 5000;
const MAX_CHARACTER_LIMIT = 15000;
const MAX_HASHTAG_CHAR_LENGTH = 160;

const editableProps: TEditableProps<EditorValue> = {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,7 @@ export const MediaEmbedToolbarButton = ({
loading={progress > 0}
onFileSelected={handleFileSelected}
accept={['video/mp4', 'video/x-m4v', 'video/*']}
maxSize={100}
maxSize={210}
placeholder={i18n.t('Post_Create.Upload.Video.Placeholder')}
usage="post"
/>
Expand Down
6 changes: 6 additions & 0 deletions src/components/common/NodeViewer/formatter.ts
Original file line number Diff line number Diff line change
Expand Up @@ -186,6 +186,12 @@ export const minimize = (
if ([ELEMENT_IMAGE].includes(element.type)) {
urls.push(element.url as string);
}
if ([ELEMENT_MEDIA_EMBED].includes(element.type)) {
nodes.push(element);
}
// if ([ELEMENT_LINK].includes(element.type)) {
// nodes.push(element);
// }
}

if (urls.length) {
Expand Down
2 changes: 1 addition & 1 deletion src/locale/en.json
Original file line number Diff line number Diff line change
Expand Up @@ -654,7 +654,7 @@
"Btn_Confirm": "Confirm",
"Video": {
"Title": "Upload Video",
"Placeholder": "Upload .mp4 video file with size less than 100Mb"
"Placeholder": "Upload .mp4 video file with size less than 200Mb"
},
"Image": {
"Title": "Upload Picture"
Expand Down
2 changes: 1 addition & 1 deletion src/locale/fra.json
Original file line number Diff line number Diff line change
Expand Up @@ -654,7 +654,7 @@
"Btn_Confirm": "Confirmer",
"Video": {
"Title": "Télécharger une video",
"Placeholder": "Téléchargez un fichier vidéo .mp4 d'une taille inférieure à 100 Mo"
"Placeholder": "Téléchargez un fichier vidéo .mp4 d'une taille inférieure à 200 Mo"
},
"Image": {
"Title": "Charger une photo"
Expand Down
2 changes: 1 addition & 1 deletion src/locale/id.json
Original file line number Diff line number Diff line change
Expand Up @@ -640,7 +640,7 @@
"Btn_Confirm": "Konfirmasi",
"Video": {
"Title": "Unggah video",
"Placeholder": "Unggah file video .mp4 dengan ukuran kurang dari 100Mb"
"Placeholder": "Unggah file video .mp4 dengan ukuran kurang dari 200Mb"
},
"Image": {
"Title": "Unggah Gambar"
Expand Down
2 changes: 1 addition & 1 deletion src/locale/ru.json
Original file line number Diff line number Diff line change
Expand Up @@ -645,7 +645,7 @@
"Btn_Confirm": "Подтвердить",
"Video": {
"Title": "Загрузить видео",
"Placeholder": "Загрузить видео файл .mp4 размером до 100 MB"
"Placeholder": "Загрузить видео файл .mp4 размером до 200 MB"
},
"Image": {
"Title": "Загрузить"
Expand Down

0 comments on commit 1871d50

Please sign in to comment.