File tree Expand file tree Collapse file tree 9 files changed +25
-20
lines changed Expand file tree Collapse file tree 9 files changed +25
-20
lines changed Original file line number Diff line number Diff line change 11
11
"react" : " ^17.0.2" ,
12
12
"react-dom" : " ^17.0.2" ,
13
13
"react-scripts" : " 4.0.3" ,
14
+ "uuid" : " ^8.3.2" ,
14
15
"web-vitals" : " ^1.1.2"
15
16
},
16
17
"scripts" : {
Original file line number Diff line number Diff line change @@ -4,31 +4,35 @@ import ResultContainer from '../ResultContainer/ResultContainer';
4
4
import SearchBox from '../SearchBox/SearchBox' ;
5
5
import './App.css' ;
6
6
7
+ //Adding up Git-hub Startup-Name Generator
7
8
const name = require ( '@rstacruz/startup-name-generator' ) ;
8
9
9
10
class App extends React . Component {
10
11
12
+ //State
11
13
state = {
12
14
headerTitle : "Name-It!" ,
13
15
isChanged : true ,
14
16
suggestedNames : [ ]
15
17
} ;
16
18
19
+ //CallBack function triggered from SearchBox Component
17
20
handleInputChange = ( InputChangeValue ) => {
18
21
this . setState ( {
19
22
isChanged : ! InputChangeValue ,
20
23
suggestedNames : InputChangeValue ? name ( InputChangeValue ) : [ ]
21
24
} ) ;
22
25
} ;
23
26
27
+ //Rendering Components
24
28
render ( ) {
25
29
return (
26
30
< div >
27
- < Header isChanged = { this . state . isChanged } headTitle = { this . state . headerTitle } />
31
+ < Header isChanged = { this . state . isChanged } headTitle = { this . state . headerTitle } />
28
32
< SearchBox onInputChange = { this . handleInputChange } />
29
33
< ResultContainer suggestedNames = { this . state . suggestedNames } />
30
34
</ div >
31
- )
35
+ ) ;
32
36
}
33
37
}
34
38
Original file line number Diff line number Diff line change 2
2
display : flex;
3
3
flex-direction : column;
4
4
align-items : center;
5
- margin-top : 100 px ;
5
+ margin-top : 60 px ;
6
6
}
7
7
8
8
.head-image {
11
11
}
12
12
13
13
.head-image-expanded {
14
- min-width : 230 px ;
15
- max-width : 250 px ;
14
+ min-width : 250 px ;
15
+ max-width : 230 px ;
16
16
}
17
17
18
18
.head-image-contracted {
23
23
.head-text {
24
24
font-family : 'Hachi Maru Pop' , cursive;
25
25
margin : 5px 0px 15px 0px ;
26
- transition : font-size 1s ;
26
+ transition : font-size 1s , font-size 1 s ;
27
27
}
28
28
29
29
.head-text-expanded {
30
- font-size : 50 px ;
30
+ font-size : 36 px ;
31
31
}
32
32
33
33
.head-text-contracted {
Original file line number Diff line number Diff line change @@ -5,7 +5,9 @@ const nameCheapURL = 'https://www.namecheap.com/domains/registration/results/?do
5
5
6
6
const NameCard = ( { suggestedName } ) => {
7
7
return (
8
- < a className = "card-link" href = { `${ nameCheapURL } ${ suggestedName } ` } >
8
+ < a target = "_blank"
9
+ rel = "noreferrer"
10
+ className = "card-link" href = { `${ nameCheapURL } ${ suggestedName } ` } >
9
11
< div className = "name-card-container" >
10
12
< p className = "name-card" > { suggestedName } </ p >
11
13
</ div >
Original file line number Diff line number Diff line change 2
2
display : flex;
3
3
justify-content : center;
4
4
flex-wrap : wrap;
5
- padding : 40px 100px ;
6
- font-size : larger;
7
-
5
+ padding : 20px 40px ;
8
6
}
Original file line number Diff line number Diff line change @@ -2,10 +2,12 @@ import React from 'react';
2
2
import NameCard from '../NameCard/NameCard' ;
3
3
import './ResultContainer.css' ;
4
4
5
+ const { v4 : uuidv4 } = require ( 'uuid' ) ;
6
+
5
7
const resultContainer = ( { suggestedNames } ) => {
6
8
7
9
const suggestedNamesJSX = suggestedNames . map ( ( suggestedName ) => {
8
- return < NameCard key = { suggestedName } suggestedName = { suggestedName } />
10
+ return < NameCard key = { uuidv4 ( ) } suggestedName = { suggestedName } />
9
11
} ) ;
10
12
11
13
return (
Original file line number Diff line number Diff line change 1
1
.search-container {
2
2
display : flex;
3
3
justify-content : center;
4
- margin : 10px 30 px 0 px 30 px ;
4
+ margin : 10px ;
5
5
}
6
6
7
7
.search-input {
8
- padding : 15 px 80 px ;
9
- font-size : x-large;
10
- width : 400 px ;
8
+ padding : 8 px 15 px ;
9
+
10
+ width : 250 px ;
11
11
border-width : 0 ;
12
12
background : # a592f2 ;
13
13
color : # e7e9f0 ;
17
17
18
18
.search-input ::placeholder {
19
19
color : # e7e9f0 ;
20
- font-size : x-large;
21
20
}
22
21
23
22
.search-input : focus {
Original file line number Diff line number Diff line change @@ -7,7 +7,7 @@ const searchBox = ({ onInputChange }) => {
7
7
< input
8
8
onChange = { ( event ) => onInputChange ( event . target . value ) }
9
9
className = "search-input"
10
- placeholder = "Search your Keywords here! " />
10
+ placeholder = "Type Keywords Here " />
11
11
</ div >
12
12
) ;
13
13
} ;
You can’t perform that action at this time.
0 commit comments