@ -2,6 +2,7 @@ import React, { Component } from 'react'
import { Input , Segment , Form , Header , Card , Button , Select , Icon } from 'semantic-ui-react'
import { Input , Segment , Form , Header , Card , Button , Select , Icon } from 'semantic-ui-react'
import DatePicker from 'react-datepicker' ;
import DatePicker from 'react-datepicker' ;
import moment from 'moment' ;
import moment from 'moment' ;
import MediaQuery from 'react-responsive' ;
import 'react-datepicker/dist/react-datepicker.css' ;
import 'react-datepicker/dist/react-datepicker.css' ;
import CustomCard from '../Card/Card'
import CustomCard from '../Card/Card'
@ -76,10 +77,17 @@ export default class HomeComponent extends Component {
< Form . Field >
< Form . Field >
< Input required size = 'large' type = 'url' ref = { input => this . urlInput = input } onChange = { this . handleURLChange } placeholder = 'Paste a link to shorten it' action >
< Input required size = 'large' type = 'url' ref = { input => this . urlInput = input } onChange = { this . handleURLChange } placeholder = 'Paste a link to shorten it' action >
< input / >
< input / >
< MediaQuery query = "(min-width: 768px)" >
< Select options = { options } placeholder = 'Settings' onChange = { this . onSettingsChange } multiple / >
< Select options = { options } placeholder = 'Settings' onChange = { this . onSettingsChange } multiple / >
< / M e d i a Q u e r y >
< Button type = 'submit' > Shorten < Icon name = "arrow right" / > < / B u t t o n >
< Button type = 'submit' > Shorten < Icon name = "arrow right" / > < / B u t t o n >
< / I n p u t >
< / I n p u t >
< / F o r m . F i e l d >
< / F o r m . F i e l d >
< MediaQuery query = "(max-width: 767px)" >
< Form . Field >
< Select options = { options } placeholder = 'Settings' onChange = { this . onSettingsChange } multiple fluid / >
< / F o r m . F i e l d >
< / M e d i a Q u e r y >
< Form . Group widths = 'equal' >
< Form . Group widths = 'equal' >
{ setOptions . indexOf ( "custom" ) > - 1 && < Form . Field error = { showCustomIDError } >
{ setOptions . indexOf ( "custom" ) > - 1 && < Form . Field error = { showCustomIDError } >
< Input label = { window . location . origin + "/" } onChange = { this . handleCustomIDChange } placeholder = 'my-shortened-url' / >
< Input label = { window . location . origin + "/" } onChange = { this . handleCustomIDChange } placeholder = 'my-shortened-url' / >
@ -93,7 +101,7 @@ export default class HomeComponent extends Component {
< / F o r m . G r o u p >
< / F o r m . G r o u p >
< / F o r m >
< / F o r m >
< / S e g m e n t >
< / S e g m e n t >
< Card . Group itemsPerRow = "2" >
< Card . Group itemsPerRow = "2" stackable style = { { marginTop : "1rem" } } >
{ links . map ( ( link , i ) => < CustomCard key = { i } header = { new URL ( link [ 1 ] ) . hostname } expireDate = { link [ 2 ] } metaHeader = { link [ 1 ] } description = { link [ 0 ] } / > ) }
{ links . map ( ( link , i ) => < CustomCard key = { i } header = { new URL ( link [ 1 ] ) . hostname } expireDate = { link [ 2 ] } metaHeader = { link [ 1 ] } description = { link [ 0 ] } / > ) }
< / C a r d . G r o u p >
< / C a r d . G r o u p >
< / d i v >
< / d i v >