Skip to content

Commit

Permalink
Merge remote-tracking branch 'origin/vls-65' into vls-65
Browse files Browse the repository at this point in the history
  • Loading branch information
veglem committed May 8, 2024
2 parents 20a2a2e + 9f15c16 commit 4669259
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 1 deletion.
10 changes: 9 additions & 1 deletion public/src/components/Editor/Editor.sass
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,14 @@
content: "Введите '/' для комманд"
color: rgba(255, 255, 255, 0.7)
cursor: text
//animation: showAnim 0.5s
animation: fadeIn 0.3s

@keyframes fadeIn
0%
opacity: 0

99%
opacity: 1

.subnote-wrapper
background: $modal-background
Expand All @@ -70,6 +77,7 @@
transition: 0.2s ease
border: 1px solid #2b3b55
margin: 15px 2px
user-select: none

&:hover
cursor: pointer
Expand Down
9 changes: 9 additions & 0 deletions public/src/components/LinkInput/LinkInput.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -23,11 +23,20 @@ export class LinkInput extends ScReact.Component<any, any> {

handleSubmit = () => {
if (this.state.value) {
console.log(this.isUrlValid(this.state.value))
this.props.onSubmit(this.state.value);
this.clearValue();
}
};

isUrlValid(userInput) {
let res = userInput.match(/(http(s)?:\/\/.)?(www\.)?[-a-zA-Z0-9@:%._\+~#=]{2,256}\.[a-z]{2,6}\b([-a-zA-Z0-9@:%_\+.~#?&//=]*)/g);
if (res == null)
return false;
else
return true;
}

render() {
return (
<div className={'link-input-container ' + (this.props.open ? 'open' : '')}>
Expand Down

0 comments on commit 4669259

Please sign in to comment.