Skip to content

Commit

Permalink
fixed sync lazyInject parameter
Browse files Browse the repository at this point in the history
  • Loading branch information
HillLiu committed Mar 9, 2022
1 parent 7710af0 commit 8c58bc7
Show file tree
Hide file tree
Showing 7 changed files with 173 additions and 205 deletions.
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "pmvc_react_portfolio",
"version": "0.2.1",
"version": "0.3.0",
"description": "React portfolio",
"repository": "pmvc-theme/pmvc_react_portfolio",
"main": "./build/cjs/src/index.js",
Expand Down
6 changes: 3 additions & 3 deletions ui/molecules/PortfolioModal.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -6,16 +6,15 @@ import {
import {lazyInject} from 'react-atomic-molecule';
import XIco from 'ricon/X';

let injects;

class PortfolioModal extends Component
{
constructor(props)
{
super(props);
injects = lazyInject(
injects,
InjectStyles
InjectStyles,
injects
);
}

Expand Down Expand Up @@ -102,6 +101,7 @@ const Styles = {
}
};

let injects;
const InjectStyles = {
fullScreen: [
{
Expand Down
70 changes: 35 additions & 35 deletions ui/organisms/AboutMe.jsx
Original file line number Diff line number Diff line change
@@ -1,16 +1,16 @@
import React from 'react';
import {CardView} from 'react-atomic-organism';
import {lazyInject, Description, List, Item} from 'react-atomic-molecule';
import get from 'get-object-value';
import React from "react";
import { CardView } from "react-atomic-organism";
import { useLazyInject, Description, List, Item } from "react-atomic-molecule";
import get from "get-object-value";

import Header from '../molecules/AnimateHeader';
import Content from '../molecules/AnimateContent';
import Header from "../molecules/AnimateHeader";
import Content from "../molecules/AnimateContent";

const CardList = props => {
const {header, content} = props;
const CardList = (props) => {
const { header, content } = props;
return (
<div className="pure-g">
{get(props, ['image'], []).map((item, num) => (
{get(props, ["image"], []).map((item, num) => (
<div key={num} className="pure-u-1 pure-u-md-1-2">
<CardView
imageSrc={item}
Expand All @@ -25,24 +25,24 @@ const CardList = props => {
);
};

const ListComp = ({list}) => {
const ListComp = ({ list }) => {
return (
<List type="items" style={Styles.list}>
{
list.map( (item, key) => <Item key={key}>{item}</Item>)
}
{list.map((item, key) => (
<Item key={key}>{item}</Item>
))}
</List>
);
}
};

const AboutMe = props => {
const {header, content, list, card} = props;
injects = lazyInject(injects, InjectStyles);
const AboutMe = (props) => {
const { header, content, list, card } = props;
injects = useLazyInject( InjectStyles, injects );
return (
<div className="about-me" style={Styles.container}>
<Header>{header}</Header>
<Content style={Styles.content}>
<Description>{content.split('[br]')}</Description>
<Description>{content.split("[br]")}</Description>
{list ? <ListComp list={list} /> : null}
</Content>
{card ? <CardList {...card} /> : null}
Expand All @@ -55,41 +55,41 @@ export default AboutMe;
const Styles = {
container: {
maxWidth: 800,
margin: '0 auto',
margin: "0 auto",
},
card: {
background: 'transparent',
boxShadow: 'none',
color: '#fff',
textAlign: 'center',
fontFamily: 'Raleway, sans-serif',
margin: '0 auto',
background: "transparent",
boxShadow: "none",
color: "#fff",
textAlign: "center",
fontFamily: "Raleway, sans-serif",
margin: "0 auto",
},
content: {
marginBottom: '50px',
marginBottom: "50px",
},
list: {
paddingTop: 88
}
paddingTop: 88,
},
};

let injects;
const InjectStyles = {
cardHeader: [
{
color: '#fff',
fontSize: '1.75rem',
color: "#fff",
fontSize: "1.75rem",
paddingBottom: 30,
borderBottom: '1px solid #3d3d3d',
borderBottom: "1px solid #3d3d3d",
marginBottom: 40,
},
'.aboutme.ui.card>.content>.header',
".aboutme.ui.card>.content>.header",
],
cardDescription: [
{
color: '#fff',
lineHeight: '1.8',
color: "#fff",
lineHeight: "1.8",
},
'.aboutme.ui.card>.content>.description',
".aboutme.ui.card>.content>.description",
],
};
Loading

0 comments on commit 8c58bc7

Please sign in to comment.