Skip to content

Commit 4e6cd79

Browse files
committed
2 parents 70d2bba + 4c15c83 commit 4e6cd79

File tree

16 files changed

+378
-8263
lines changed

16 files changed

+378
-8263
lines changed
Lines changed: 35 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,35 @@
1+
name: "Deploy"
2+
3+
on:
4+
release:
5+
types:
6+
- published
7+
push:
8+
branches:
9+
- dev
10+
workflow_dispatch:
11+
12+
jobs:
13+
vercel:
14+
runs-on: ubuntu-latest
15+
name: "Deploy Front-End"
16+
17+
steps:
18+
- uses: actions/checkout@v2
19+
- uses: actions/setup-node@v1
20+
with:
21+
node-version: "14"
22+
registry-url: https://registry.npmjs.org/
23+
24+
- name: "Deploy to Vercel"
25+
run: |
26+
prodRun=""
27+
if [[ ${GITHUB_REF} == "refs/heads/main" ]]; then
28+
prodRun="--prod"
29+
fi
30+
31+
npx vercel --token ${VERCEL_TOKEN} $prodRun
32+
env:
33+
VERCEL_TOKEN: ${{ secrets.VERCEL_TOKEN }}
34+
VERCEL_PROJECT_ID: ${{ secrets.VERCEL_PROJECT_ID }}
35+
VERCEL_ORG_ID: ${{ secrets.VERCEL_ORG_ID }}

.gitignore

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,4 +5,5 @@
55
.env
66
package-lock.json
77
/client/package-lock.json
8-
yarn.lock
8+
yarn.lock
9+
.vercel

README.md

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -43,6 +43,8 @@ There are two ways to setup the project: manually or using the Dockerfile. Read
4343
```
4444

4545
2. Setup the backend code -
46+
47+
__NOTE:__ For Frontend Developers, if they dont want to setup the Backend Code, they can skip the Step 2, and make sure they follow the optional step mentioned in Step 4
4648

4749
- Create a `.env` file and the format should be as given in `.env.example`.
4850
- Clone the code & install the modules-
@@ -76,6 +78,11 @@ There are two ways to setup the project: manually or using the Dockerfile. Read
7678
```
7779
7880
- Run the client index `npm start`.
81+
82+
__OPTIONAL (Recommended For Frontend Developers):__ Can just change the path [here](https://github.com/Mayank0255/Stackoverflow-Clone-Frontend/blob/53b64c37981c618802547cd17483525532de83f0/src/config/index.js#L6) to this `https://stackoverflow-clone-backend.herokuapp.com`
83+
Now, it will hit PROD
84+
85+
Let me know if you are interested and would want me to assign it to you
7986
8087
### Docker Setup
8188

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@
1414
"axios": "^0.24.0",
1515
"bad-words": "^3.0.4",
1616
"feather-icons": "^4.28.0",
17-
"moment": "^2.29.2",
17+
"moment": "^2.29.4",
1818
"prop-types": "^15.8.0",
1919
"react": "^17.0.2",
2020
"react-dom": "^17.0.2",

src/components/Header/Header.component.jsx

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -106,7 +106,7 @@ const Header = ({auth: {isAuthenticated, loading, user}, logout}) => {
106106
<Fragment>{isAuthenticated ? authTabs : guestTabs}</Fragment>
107107
)}
108108
</div>
109-
<div className="header-search-div">
109+
110110
<form
111111
id='search'
112112
onSubmit={() => history.push('/questions')}
@@ -125,6 +125,7 @@ const Header = ({auth: {isAuthenticated, loading, user}, logout}) => {
125125
<Search />
126126
</div>
127127
</form>
128+
<div className="header-search-div">
128129
<Search className="search-icon" onClick={() => setSearchState(!searchState)} />
129130
{!loading && (
130131
<Fragment>{isAuthenticated ? authLinks : guestLinks}</Fragment>

src/components/Header/Header.styles.scss

Lines changed: 29 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -93,7 +93,6 @@
9393

9494
.header-search-div {
9595
display: flex;
96-
//margin-left: 10%;
9796
justify-content: flex-end;
9897
align-items: center
9998
}
@@ -137,6 +136,13 @@
137136
right: 5%;
138137
}
139138

139+
.s-input__search{
140+
margin-top: 10px;
141+
}
142+
.s-input-icon {
143+
margin-top: -2px;
144+
}
145+
140146
// Side Navbar
141147

142148
.hamburger {
@@ -176,16 +182,18 @@
176182
}
177183
.header-search-div {
178184
justify-content: space-around;
179-
form {
180-
&:first-of-type {
181-
display: none;
182-
}
185+
}
186+
.searchbar {
187+
display: none;
183188
}
184189
.search-icon {
185190
display: block;
186191
margin-right: 1rem;
192+
position: absolute;
193+
left: 77%;
194+
top: 30%;
187195
}
188-
}
196+
189197
.btns {
190198
margin-right: 20px;
191199
}
@@ -202,6 +210,12 @@
202210
.full-logo {
203211
display: none;
204212
}
213+
.search-icon {
214+
display: block;
215+
position: relative;
216+
left: 15%;
217+
top: 30%;
218+
}
205219
}
206220

207221
@media (max-width: 560px) {
@@ -220,6 +234,9 @@
220234
}
221235
.search-icon {
222236
display: block;
237+
position: relative;
238+
left: 5%;
239+
top: 30%;
223240
}
224241
.hamburger {
225242
display: block;
@@ -239,6 +256,12 @@
239256
margin-left: -4.7rem;
240257
}
241258
}
259+
.search-icon {
260+
display: block;
261+
position: relative;
262+
left: 5%;
263+
top: 30%;
264+
}
242265
}
243266

244267
@media (max-width: 390px) {

src/components/LayoutWrapper/SideBar/SideBarData.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ export const SideBarData = [
44
{
55
link: '/questions',
66
icon: <GlobalIcon className='icon' />,
7-
text: 'Stack Overflow',
7+
text: 'Questions',
88
},
99
{
1010
link: '/tags',

src/components/PostItem/PostItem.component.jsx

Lines changed: 7 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ const PostItem = ({
3030
}) => {
3131
const answerVoteUp = (
3232
<div className="vote answer">
33-
<span className="vote-count fc-green-500">{answer_count}</span>
33+
<span className="vote-count">{answer_count}</span>
3434
<div className="count-text">answers</div>
3535
</div>
3636
);
@@ -67,17 +67,14 @@ const PostItem = ({
6767
<div
6868
className="brief"
6969
dangerouslySetInnerHTML={{
70-
__html: injectEllipsis(htmlSubstring(censorBadWords(body), 200)),
70+
__html: injectEllipsis(censorBadWords(htmlSubstring(body, 200))),
7171
}}
7272
></div>
73-
{tags.map((tag, index) => (
74-
<TagBadge
75-
key={index}
76-
tag_name={tag.tagname}
77-
size={"s-tag"}
78-
float={"left"}
79-
/>
80-
))}
73+
<div className="profile-tags">
74+
{tags.map((tag, index) => (
75+
<TagBadge key={index} tag_name={tag.tagname} size={"s-tag"} />
76+
))}
77+
</div>
8178
<UserCard
8279
created_at={created_at}
8380
user_id={user_id}

0 commit comments

Comments
 (0)