Skip to content

Commit a5f4c4a

Browse files
author
ahmetkuslular
committed
FIX: client js packages fixes and welcome screen style
1 parent 43b4a2e commit a5f4c4a

File tree

5 files changed

+61
-47
lines changed

5 files changed

+61
-47
lines changed

package.json

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,6 @@
4646
"compression": "^1.7.4",
4747
"cookie-parser": "1.4.3",
4848
"copy-webpack-plugin": "4.5.2",
49-
"core-js": "3.20.3",
5049
"css-loader": "6.5.1",
5150
"css-minimizer-webpack-plugin": "3.4.1",
5251
"eev": "0.1.5",

src/universal/partials/Welcome/PartialCards.js

Lines changed: 2 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -5,15 +5,6 @@ import { ServerStyleSheet } from 'styled-components';
55
import partials from './partials';
66
import groupBy from '../../utils/lodash/groupBy';
77

8-
const STATUS_COLOR = {
9-
live: '#8dc63f',
10-
dev: '#FF6000',
11-
page: '#00abff',
12-
1: '#9b59b6',
13-
2: '#c0392b',
14-
3: '#16a085'
15-
};
16-
178
const sheet = new ServerStyleSheet();
189

1910
const Welcome = () => {
@@ -26,10 +17,8 @@ const Welcome = () => {
2617
className="link"
2718
>
2819
<div className="card">
29-
<div className="card-header">
30-
<div className="badge" style={{ backgroundColor: STATUS_COLOR[status] }}>
31-
{title}
32-
</div>
20+
<div className="ribbon-wrapper">
21+
<div className={`ribbon color-${status}`}> {title}</div>
3322
</div>
3423
<div className="card-title">{item.name}</div>
3524
<div className="card-subtitle">

src/universal/partials/Welcome/welcomeStyle.js

Lines changed: 55 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -10,8 +10,8 @@ const welcomeStyle = () => {
1010
--theme-bg-color: #fafafb;
1111
--body-font: "Poppins", sans-serif;
1212
--body-color: #2f2f33;
13-
--active-color: #0162ff;
14-
--active-light-color: #e1ebfb;
13+
--active-color: #4e4e4e;
14+
--active-light-color: #f1f1f1;
1515
--header-bg-color: #fff;
1616
--border-color: #d8d8d8;
1717
--alert-bg-color: #e8f2ff;
@@ -157,7 +157,7 @@ const welcomeStyle = () => {
157157
}
158158
.group-title {
159159
font-size: 24px;
160-
font-weight: 600;
160+
font-weight: 700;
161161
}
162162
.link {
163163
color: inherit;
@@ -190,12 +190,13 @@ const welcomeStyle = () => {
190190
}
191191
192192
.card {
193-
padding: 20px 16px;
193+
padding: 16px 16px;
194194
background-color: var(--header-bg-color);
195195
border-radius: 8px;
196196
cursor: pointer;
197197
transition: 0.2s;
198198
text-decoration: none;
199+
position: relative;
199200
}
200201
.card:hover {
201202
transform: scale(1.02);
@@ -207,8 +208,7 @@ const welcomeStyle = () => {
207208
}
208209
.card-title {
209210
font-weight: 600;
210-
margin-top: 16px;
211-
font-size: 14px;
211+
font-size: 16px;
212212
}
213213
.card-subtitle {
214214
color: var(--subtitle-color);
@@ -220,14 +220,62 @@ const welcomeStyle = () => {
220220
display: flex;
221221
align-items: flex-start;
222222
}
223+
224+
.ribbon-wrapper {
225+
width: 85px;
226+
height: 88px;
227+
overflow: hidden;
228+
position: absolute;
229+
top: 0;
230+
right: 0;
231+
}
232+
233+
.ribbon {
234+
font-size: 10px;
235+
font-weight: bold;
236+
color: var(--header-bg-color);;
237+
text-align: center;
238+
-webkit-transform: rotate(45deg);
239+
-moz-transform: rotate(45deg);
240+
-ms-transform: rotate(45deg);
241+
-o-transform: rotate(45deg);
242+
position: relative;
243+
padding: 0;
244+
left: 26px;
245+
top: 14px;
246+
width: 80px;
247+
-webkit-box-shadow: 0px 0px 3px rgba(0,0,0,0.3);
248+
-moz-box-shadow: 0px 0px 3px rgba(0,0,0,0.3);
249+
box-shadow: 0px 0px 3px rgba(0,0,0,0.3);
250+
}
251+
252+
.color-live{
253+
background-color: #badc58;
254+
}
255+
.color-dev{
256+
background-color: #f0932b;
257+
}
258+
.color-page{
259+
background-color: #00abff;
260+
}
261+
.color-1{
262+
background-color: #9b59b6;
263+
}
264+
.color-2{
265+
background-color: #c0392b;
266+
}
267+
.color-3{
268+
background-color: #16a085;
269+
}
270+
223271
.badge{
224272
display: flex;
225273
align-items: center;
226274
justify-content: center;
227275
background-color: #f50;
228276
font-weight: 600;
229277
margin-top: 16px;
230-
font-size: 14px;
278+
font-size: 10px;
231279
padding: 5px 10px;
232280
color: white;
233281
border-radius: 5px;

webpack.client.config.js

Lines changed: 3 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -25,22 +25,19 @@ const appConfigFilePath = `${voltranConfig.appConfigFile.entry}/${env}.conf.js`;
2525
const appConfig = require(appConfigFilePath);
2626
const commonConfig = require('./webpack.common.config');
2727
const postCssConfig = require('./postcss.config');
28-
const babelConfig = require('./babel.server.config');
2928

3029
const voltranClientConfigPath = voltranConfig.webpackConfiguration.client;
3130
const voltranClientConfig = voltranClientConfigPath
3231
? require(voltranConfig.webpackConfiguration.client)
3332
: '';
3433

35-
const normalizeUrl = require('./lib/os.js');
3634
const replaceString = require('./config/string.js');
3735

3836
const fragmentManifest = require(voltranConfig.routing.dictionary);
3937
const fixFragmentManifest = require('./src/universal/core/route/dictionary');
4038

41-
const isDebug = voltranConfig.dev;
39+
const isDebug = appConfig.dev;
4240
const reScript = /\.(js|jsx|mjs)$/;
43-
const distFolderPath = voltranConfig.distFolder;
4441
const isProd = process.env.BROWSER && process.env.VOLTRAN_ENV === 'prod';
4542
const hideCssPrefixOnTest = voltranConfig.hideCssPrefixOnTest;
4643

@@ -73,27 +70,8 @@ const appConfigFileTarget = `${voltranConfig.appConfigFile.output.path}/${voltra
7370

7471
fs.copyFileSync(appConfigFilePath, appConfigFileTarget);
7572

76-
chunks.client.unshift('regenerator-runtime/runtime.js', 'core-js/stable', 'intersection-observer');
77-
7873
if (isDebug) {
79-
const appConfigJSONContent = require(appConfigFileTarget);
80-
81-
for (const service in appConfigJSONContent.services) {
82-
appConfigJSONContent.services[service].clientUrl =
83-
appConfigJSONContent.services[service].serverUrl;
84-
}
85-
86-
const moduleExportsText = 'module.exports';
87-
const appConfigFileContent = fs.readFileSync(appConfigFileTarget).toString();
88-
const moduleExportsIndex = appConfigFileContent.indexOf(moduleExportsText);
89-
90-
let context = appConfigFileContent.substr(0, moduleExportsIndex + moduleExportsText.length);
91-
context += '=';
92-
context += JSON.stringify(appConfigJSONContent);
93-
context += ';';
94-
95-
fs.writeFileSync(appConfigFileTarget, context);
96-
74+
chunks.client.unshift('regenerator-runtime/runtime.js');
9775
chunks.client.push('webpack-hot-middleware/client');
9876
}
9977

@@ -234,7 +212,7 @@ const clientConfig = merge(commonConfig, voltranClientConfig, {
234212
? []
235213
: [
236214
new CleanWebpackPlugin({
237-
verbose: false,
215+
verbose: true,
238216
dangerouslyAllowCleanPatternsOutsideProject: true
239217
})
240218
]),

webpack.server.config.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -122,7 +122,7 @@ const serverConfig = merge(commonConfig, voltranServerConfig, {
122122

123123
plugins: [
124124
new CleanWebpackPlugin({
125-
verbose: false,
125+
verbose: true,
126126
dangerouslyAllowCleanPatternsOutsideProject: true
127127
}),
128128

0 commit comments

Comments
 (0)