@mjhls/mjh-framework 1.0.351 → 1.0.353

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/README.md CHANGED
@@ -1,5 +1,5 @@
1
1
 
2
- # mjh-framework v. 1.0.351
2
+ # mjh-framework v. 1.0.353
3
3
 
4
4
 
5
5
  > Foundation Framework
@@ -53,61 +53,65 @@ var PublicationDeckStack = function PublicationDeckStack(props) {
53
53
 
54
54
  return React__default.createElement(
55
55
  Col,
56
- { md: 12, lg: 12, style: { display: 'flex', flex: '1 0 auto' }, key: index },
56
+ { md: 12, lg: 12, key: index },
57
57
  React__default.createElement(
58
58
  Card,
59
59
  { style: { boxShadow: 'none', borderBottom: '1px solid #aaa', paddingBottom: '1rem' } },
60
60
  React__default.createElement(
61
61
  'a',
62
62
  { href: '/view/' + link },
63
- coverImage && React__default.createElement(
64
- index$1.LazyLoad,
65
- { height: imageHeight },
66
- React__default.createElement(Card.Img, {
67
- variant: 'right',
68
- src: renderCardImage({ coverImage: coverImage, imageHeight: imageHeight, imageWidth: imageWidth, client: client, Settings: Settings }),
69
- alt: title,
70
- style: { width: '170px', height: 'auto', objectFit: 'contain', padding: '1rem', float: 'left', marginTop: '1rem', paddingBottom: '1rem' }
71
- })
72
- ),
73
63
  React__default.createElement(
74
- Card.Body,
75
- null,
76
- section ? React__default.createElement(
77
- Badge,
78
- { variant: 'success' },
79
- section.name
80
- ) : '',
81
- React__default.createElement(
82
- Card.Title,
83
- { style: { color: '#121212', fontSize: '1.1rem' } },
84
- React__default.createElement(
85
- 'span',
86
- null,
87
- title
88
- ),
89
- React__default.createElement('br', null)
64
+ 'div',
65
+ { style: { display: 'flex', flex: '1 0 auto' } },
66
+ coverImage && React__default.createElement(
67
+ index$1.LazyLoad,
68
+ { height: imageHeight },
69
+ React__default.createElement(Card.Img, {
70
+ variant: 'right',
71
+ src: renderCardImage({ coverImage: coverImage, imageHeight: imageHeight, imageWidth: imageWidth, client: client, Settings: Settings }),
72
+ alt: title,
73
+ style: { width: '170px', height: 'auto', objectFit: 'contain', padding: '0.25rem', float: 'left', paddingBottom: '1rem' }
74
+ })
90
75
  ),
91
76
  React__default.createElement(
92
- 'div',
93
- { style: { float: 'left' } },
77
+ Card.Body,
78
+ { style: { padding: '0.5rem' } },
79
+ section ? React__default.createElement(
80
+ Badge,
81
+ { variant: 'success' },
82
+ section.name
83
+ ) : '',
94
84
  React__default.createElement(
95
- 'p',
96
- { style: { color: '#484848', fontSize: '.9rem', fontWeight: '600' }, className: 'mb-0' },
97
- moment.moment(published).format('MMMM DD, YYYY ')
98
- ),
99
- author.length > 0 && React__default.createElement(
100
- 'p',
101
- { style: { color: '#484848', fontSize: '.9rem', fontWeight: '600' }, className: 'mb-0' },
102
- 'By ',
103
- author
85
+ Card.Title,
86
+ { style: { color: '#121212', fontSize: '1.1rem' } },
87
+ React__default.createElement(
88
+ 'span',
89
+ null,
90
+ title
91
+ ),
92
+ React__default.createElement('br', null)
104
93
  ),
105
94
  React__default.createElement(
106
- 'p',
107
- null,
108
- summary
95
+ 'div',
96
+ { style: { float: 'left' } },
97
+ React__default.createElement(
98
+ 'p',
99
+ { style: { color: '#484848', fontSize: '.9rem', fontWeight: '600' }, className: 'mb-0' },
100
+ moment.moment(published).format('MMMM DD, YYYY ')
101
+ ),
102
+ author.length > 0 && React__default.createElement(
103
+ 'p',
104
+ { style: { color: '#484848', fontSize: '.9rem', fontWeight: '600' }, className: 'mb-0' },
105
+ 'By ',
106
+ author
107
+ )
109
108
  )
110
109
  )
110
+ ),
111
+ React__default.createElement(
112
+ 'p',
113
+ { style: { paddingLeft: '0.5rem' } },
114
+ summary
111
115
  )
112
116
  )
113
117
  )
@@ -22,6 +22,29 @@ var PublicationDeck = function PublicationDeck(props) {
22
22
  Website = props.Website,
23
23
  client = props.client;
24
24
 
25
+ var regPubs = data.filter(function (a) {
26
+ return typeof a.is_legacy === 'undefined' || a.is_legacy === false;
27
+ });
28
+ var legacyPubs = data.filter(function (a) {
29
+ return a.is_legacy === true;
30
+ });
31
+
32
+ var sortedLegacyPubs = legacyPubs.sort(function (a, b) {
33
+ if (parseInt(a.childIssue.year) < parseInt(b.childIssue.year)) {
34
+ return 1;
35
+ } else {
36
+ return -1;
37
+ }
38
+ });
39
+
40
+ var sortedRegPubs = regPubs.sort(function (a, b) {
41
+ if (parseInt(a.childIssue.year) < parseInt(b.childIssue.year)) {
42
+ return 1;
43
+ } else {
44
+ return -1;
45
+ }
46
+ });
47
+
25
48
  var urlFor = function urlFor(source) {
26
49
  var builder = index.imageUrlBuilder(client);
27
50
  return builder.image(source).auto('format');
@@ -38,47 +61,111 @@ var PublicationDeck = function PublicationDeck(props) {
38
61
  }
39
62
  };
40
63
 
41
- return React__default.createElement(
42
- Row,
43
- null,
44
- data && data.length ? data.map(function (row, index) {
45
- return row.identifier && row.identifier.current && React__default.createElement(
46
- Col,
47
- { xs: 6, sm: 6, md: 6, lg: 4, style: { display: 'flex', flex: '1 0 auto' }, key: index },
48
- React__default.createElement(
49
- Card,
50
- { className: 'block-card', style: { width: '200px' } },
51
- React__default.createElement(
52
- 'a',
53
- { href: href + '/' + row.identifier.current },
54
- row.childIssue && row.childIssue.thumbnail && React__default.createElement(
55
- index$1.LazyLoad,
56
- { height: imageHeight },
57
- React__default.createElement(Card.Img, {
58
- variant: 'top',
59
- src: renderCardImage(row.childIssue.thumbnail),
60
- alt: row.name,
61
- style: { objectFit: 'contain', maxHeight: '200px', maxWidth: '200px' }
62
- })
63
- ),
64
+ if (sortedRegPubs && sortedRegPubs.length || sortedLegacyPubs && sortedLegacyPubs.length) {
65
+ return React__default.createElement(
66
+ 'div',
67
+ { className: 'publication-wrapper', style: { paddingBottom: '150px' } },
68
+ sortedRegPubs && sortedRegPubs.length && React__default.createElement(
69
+ Row,
70
+ { className: 'regular-publication-wrapper' },
71
+ sortedRegPubs.map(function (row, index) {
72
+ return row.identifier && row.identifier.current && React__default.createElement(
73
+ Col,
74
+ { xs: 6, sm: 6, md: 6, lg: 4, style: { display: 'flex', flex: '1 0 auto' }, key: index },
64
75
  React__default.createElement(
65
- Card.Body,
66
- { style: { paddingTop: '0', paddingBottom: '2.75rem' } },
67
- React__default.createElement(
68
- Card.Title,
69
- null,
70
- row.name
71
- ),
76
+ Card,
77
+ { className: 'block-card', style: { width: '200px' } },
72
78
  React__default.createElement(
73
- Button,
74
- { style: { position: 'absolute', bottom: '1rem', left: '20%', margin: '0px' }, variant: 'secondary' },
75
- 'Browse Issues'
79
+ 'a',
80
+ { href: href + '/' + row.identifier.current },
81
+ row.childIssue && row.childIssue.thumbnail && React__default.createElement(
82
+ index$1.LazyLoad,
83
+ { height: imageHeight },
84
+ React__default.createElement(Card.Img, {
85
+ variant: 'top',
86
+ src: renderCardImage(row.childIssue.thumbnail),
87
+ alt: row.name,
88
+ style: { objectFit: 'contain', maxHeight: '200px', maxWidth: '200px' }
89
+ })
90
+ ),
91
+ React__default.createElement(
92
+ Card.Body,
93
+ { style: { paddingTop: '0', paddingBottom: '2.75rem' } },
94
+ React__default.createElement(
95
+ Card.Title,
96
+ null,
97
+ row.name
98
+ ),
99
+ React__default.createElement(
100
+ Button,
101
+ { style: { position: 'absolute', bottom: '1rem', left: '20%', margin: '0px' }, variant: 'secondary' },
102
+ 'Browse Issues'
103
+ )
104
+ )
76
105
  )
77
106
  )
78
- )
107
+ );
108
+ })
109
+ ),
110
+ sortedLegacyPubs && sortedLegacyPubs.length && React__default.createElement(
111
+ React__default.Fragment,
112
+ null,
113
+ React__default.createElement(
114
+ 'div',
115
+ { className: 'legacy-publication-title' },
116
+ React__default.createElement(
117
+ 'h2',
118
+ null,
119
+ 'Legacy'
120
+ ),
121
+ React__default.createElement('hr', null)
122
+ ),
123
+ React__default.createElement(
124
+ Row,
125
+ { className: 'legacy-publication-wrapper' },
126
+ sortedLegacyPubs.map(function (row, index) {
127
+ return row.identifier && row.identifier.current && React__default.createElement(
128
+ Col,
129
+ { xs: 6, sm: 6, md: 6, lg: 4, style: { display: 'flex', flex: '1 0 auto' }, key: index },
130
+ React__default.createElement(
131
+ Card,
132
+ { className: 'block-card', style: { width: '200px' } },
133
+ React__default.createElement(
134
+ 'a',
135
+ { href: href + '/' + row.identifier.current },
136
+ row.childIssue && row.childIssue.thumbnail && React__default.createElement(
137
+ index$1.LazyLoad,
138
+ { height: imageHeight },
139
+ React__default.createElement(Card.Img, {
140
+ variant: 'top',
141
+ src: renderCardImage(row.childIssue.thumbnail),
142
+ alt: row.name,
143
+ style: { objectFit: 'contain', maxHeight: '200px', maxWidth: '200px' }
144
+ })
145
+ ),
146
+ React__default.createElement(
147
+ Card.Body,
148
+ { style: { paddingTop: '0', paddingBottom: '2.75rem' } },
149
+ React__default.createElement(
150
+ Card.Title,
151
+ null,
152
+ row.name
153
+ ),
154
+ React__default.createElement(
155
+ Button,
156
+ { style: { position: 'absolute', bottom: '1rem', left: '20%', margin: '0px' }, variant: 'secondary' },
157
+ 'Browse Issues'
158
+ )
159
+ )
160
+ )
161
+ )
162
+ );
163
+ })
79
164
  )
80
- );
81
- }) : React__default.createElement(
165
+ )
166
+ );
167
+ } else {
168
+ return React__default.createElement(
82
169
  'div',
83
170
  null,
84
171
  React__default.createElement(
@@ -90,8 +177,8 @@ var PublicationDeck = function PublicationDeck(props) {
90
177
  'New content coming soon, please check back later.'
91
178
  )
92
179
  )
93
- )
94
- );
180
+ );
181
+ }
95
182
  };
96
183
 
97
184
  module.exports = PublicationDeck;