Skip to content

Commit

Permalink
optimize code
Browse files Browse the repository at this point in the history
  • Loading branch information
stephensu66 committed Jan 21, 2025
1 parent 2dc0d71 commit 80b4468
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions frontend/src/components/dialog/add-video-link-dialog.js
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ class AddVideoLink extends React.Component {
}

isValidVideoLink = (link) => {
const videoRegex = /v\.qq\.com|youtube\.com/i;
const videoRegex = /v\.qq\.com|youtube\.com|v\.youku\.com|bilibili\.com/i;
return videoRegex.test(link);
};

Expand All @@ -36,7 +36,7 @@ class AddVideoLink extends React.Component {
this.setState({
videoLink: videoLink,
isSubmitBtnActive: isValid,
errMessage: isValid ? '' : gettext('Please enter a valid Youtube or Tencent video URL.'),
errMessage: isValid ? '' : gettext('Please enter a valid video URL.'),
});

};
Expand Down Expand Up @@ -78,7 +78,7 @@ class AddVideoLink extends React.Component {
/>
</FormGroup>
</Form>
<div style={{ textAlign: 'center', fontSize: '12px', color: '#787774' }}>{gettext('Support Youtube and Tencent video link')}</div>
<div style={{ textAlign: 'center', fontSize: '12px', color: '#787774' }}>{gettext('Support Youtube, Tencent, Bilibili and more')}</div>
{this.state.errMessage && <Alert color='danger' className='mt-2'>{this.state.errMessage}</Alert>}
</ModalBody>
<ModalFooter>
Expand Down

0 comments on commit 80b4468

Please sign in to comment.