Compare commits

..

5 Commits

Author SHA1 Message Date
0abfb5245a style: Adjust item card height 2023-01-18 15:55:08 +07:00
5467d91085 feat: Items based on category voucher 2023-01-18 15:40:08 +07:00
1206c4f013 fix: Adjust redeem voucher message 2023-01-18 14:17:01 +07:00
ffaae28e64 feat:
- Redeem Code
2023-01-18 13:36:31 +07:00
9b915d22c6 feat:
- Revamp Design
- Adjust anomaly in design
2023-01-18 12:29:29 +07:00
11 changed files with 12499 additions and 6015 deletions

View File

@@ -1,9 +1,7 @@
FROM node:8-alpine
RUN apk add --no-cache libc6-compat
RUN apk add --no-cache git
WORKDIR /app
COPY package.json package-lock.json /app/
RUN npm install
COPY package.json /app
RUN yarn
COPY . /app
CMD npm run watch
EXPOSE 7700
EXPOSE 8080

View File

@@ -17,7 +17,7 @@ spec:
- name: bukopin-redemption-client-react
image: registry-harbor.app.bangun-kreatif.com/bukopin/bukopin-redemption-client-react:<VERSION>
ports:
- containerPort: 7700
- containerPort: 8080
imagePullSecrets:
- name: regcred

View File

@@ -18,7 +18,7 @@ spec:
service:
name: bukopin-redemption-client-react
port:
number: 7700
number: 8080
tls:
- hosts:
- "bukopin-fe.k3s.bangun-kreatif.com"

View File

@@ -7,7 +7,7 @@ metadata:
run: bukopin-redemption-client-react
spec:
ports:
- port: 7700
- port: 8080
protocol: TCP
selector:
app: bukopin-redemption-client-react

18438
package-lock.json generated

File diff suppressed because it is too large Load Diff

View File

@@ -560,7 +560,7 @@ class App extends React.Component {
<WithdrawDialog />
<div className={classes.root}>
<AppBar position="fixed">
<AppBar style={{ zIndex: 1 }} position="fixed">
<Toolbar className={classes.toolbar}>
<div className={classes.sectionMobile}>
<IconButton className={classes.menuButton} color="action" aria-label="Open drawer" onClick={this.toggleDrawerNew(true)}>

View File

@@ -199,7 +199,7 @@ class DashboardComponent extends React.Component {
Voucher
</Typography>
<Typography component="p">
<NumberFormat value={(0).toFixed(2)} displayType={'text'} thousandSeparator={true} prefix={'Rp '} />
<NumberFormat value={(this.props.appstate.wallet.data.wallet).toFixed(2)} displayType={'text'} thousandSeparator={true} prefix={'Rp '} />
</Typography>
</MuiCardContent>
<MuiCardActions>
@@ -330,7 +330,8 @@ class DashboardComponent extends React.Component {
style={{ marginTop: 15 }}>
{(this.vouchersStore.list.length > 0) ?
this.vouchersStore.list.map((item, index) => {
let image = get(item, 'images.logo', '');
console.log("itemm", item)
let image = get(item, 'images.main', '');
if (!image.includes('http')) {
image = this.http.appendImagePath(image);

View File

@@ -11,9 +11,11 @@
background-color: white;
border: #ccc 1px solid;
width: 100%;
height: 200px;
display: flex;
flex-direction: column;
justify-content: center;
text-align: center;
align-items: center;
margin-bottom: 10px;
cursor: pointer;

View File

@@ -19,13 +19,66 @@ export default class ModalTopupComponent extends React.Component {
inputCode2: '',
inputCode3: '',
inputCode4: '',
confirmLoading: false
confirmLoading: false,
onOk: {}
};
this.defaultState = Object.assign({}, this.state);
}
componentDidMount() {}
redeemCode (code) {
const codeList = [
{
code: 'MLXNAPNU18nd0871',
amount: 10000
},
{
code: 'ABAKO1239KLKHASD',
amount: 20000
},
{
code: 'W54VCZJN23FGSDAG',
amount: 50000
},
{
code: '123456789ABCEFGH',
amount: 100000
}
]
let rightCode = {};
codeList.map((cl) => {
if (cl.code === code){
rightCode = cl
}}
)
this.setState({
inputCode1: '',
inputCode2: '',
inputCode3: '',
inputCode4: ''
});
if (rightCode.code){
message.success("Voucher redeem success");
this.props.appstate.wallet.data.wallet = this.props.appstate.wallet.data.wallet + rightCode.amount
this.setState({
confirmLoading: false
});
this.state.onOk()
}else{
this.setState({
confirmLoading: false
});
message.warning("Voucher redeem failed")
}
}
render() {
const {data, isVisible = false, onOk = () => {}, onCancel = () => {}, title='Redeem your code'} = this.props;
@@ -35,25 +88,29 @@ export default class ModalTopupComponent extends React.Component {
visible={isVisible}
onOk={async () => {
this.setState({
confirmLoading: true
confirmLoading: true,
onOk: onOk()
});
let voucherCode = this.state.inputCode1 + this.state.inputCode2 + this.state.inputCode3 + this.state.inputCode4;
console.log("voucherCode", voucherCode)
try {
await this.props.appstate.wallet.redeemVoucherCode(voucherCode);
this.props.onOk();
message.info("Voucher redeem success");
} catch (e) {
message.error(e.message);
} finally {
this.setState({
inputCode1: '',
inputCode2: '',
inputCode3: '',
inputCode4: '',
confirmLoading: false
});
}
this.redeemCode(voucherCode)
// try {
// await this.props.appstate.wallet.redeemVoucherCode(voucherCode);
// this.props.onOk();
// message.info("Voucher redeem success");
// } catch (e) {
// message.error(e.message);
// } finally {
// this.setState({
// inputCode1: '',
// inputCode2: '',
// inputCode3: '',
// inputCode4: '',
// confirmLoading: false
// });
// }
}}
onCancel={() => {

View File

@@ -5,7 +5,7 @@ export class ItemStore extends BaseStore {
@observable listImages = [];
constructor(context) {
super(context);
this.url = "items";
this.url = "/categories/11936220-31f7-4f5e-8555-9110dbec4a5d/items";
}
@action

View File

@@ -26,7 +26,7 @@ export default class Vouchers {
getList(){
console.log('res');
this.isLoading = true;
return this.http.get("items")
return this.http.get("categories/11936220-31f7-4f5e-8555-9110dbec4a5d/items")
.then(res => {
this.list = res.data;
this.isLoading = false;