Skip to content

Commit 8f9d817

Browse files
committed
feat: remove AddLibrary modal and related functionality
1 parent ab57781 commit 8f9d817

File tree

4 files changed

+6
-347
lines changed

4 files changed

+6
-347
lines changed

src/components/AddLibrary.jsx

Lines changed: 0 additions & 143 deletions
This file was deleted.

src/components/LibraryAutoSuggest.jsx

Lines changed: 0 additions & 161 deletions
This file was deleted.

src/components/MainHeader.jsx

Lines changed: 1 addition & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -192,23 +192,7 @@ export function MainHeader(props) {
192192
{/*<iframe src="https://github.com/sponsors/ZenUml/button" title="Sponsor ZenUml" height="35" width="107" style="border: 0;" />*/}
193193
</button>
194194

195-
<Button
196-
onClick={props.addLibraryBtnHandler}
197-
data-event-category="ui"
198-
data-event-action="addLibraryButtonClick"
199-
className="btn--dark flex-v-center hint--rounded hint--bottom-left"
200-
style="display: none"
201-
aria-label="Add a JS/CSS library"
202-
>
203-
Add library{' '}
204-
<span
205-
id="js-external-lib-count"
206-
style={`display:${props.externalLibCount ? 'inline' : 'none'}`}
207-
class="count-label"
208-
>
209-
{props.externalLibCount}
210-
</span>
211-
</Button>
195+
212196
{!window.user ? (
213197
<button
214198
className="h-10 px-4 bg-primary rounded-lg text-gray-100 font-semibold hover:opacity-80 duration-200"

src/components/app.jsx

Lines changed: 5 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ import { MainHeader } from './MainHeader.jsx';
66
import ContentWrap from './ContentWrap.jsx';
77
import Footer from './Footer.jsx';
88
import SavedItemPane from './SavedItemPane.jsx';
9-
import AddLibrary from './AddLibrary.jsx';
9+
1010
import Modal from './Modal.jsx';
1111
import { computeHtml, computeCss, computeJs } from '../computes';
1212
import {
@@ -67,7 +67,7 @@ export default class App extends Component {
6767
this.AUTO_SAVE_INTERVAL = 15000; // 15 seconds
6868
this.modalDefaultStates = {
6969
isModalOpen: false,
70-
isAddLibraryModalOpen: false,
70+
7171
isSettingsModalOpen: false,
7272
isHelpModalOpen: false,
7373
isPricingModalOpen: false,
@@ -590,9 +590,7 @@ BookLibService.Borrow(id) {
590590
});
591591
}
592592

593-
async openAddLibrary() {
594-
await this.setState({ isAddLibraryModalOpen: true });
595-
}
593+
596594

597595
async closeSavedItemsPane() {
598596
await this.setState({
@@ -1696,7 +1694,7 @@ BookLibService.Borrow(id) {
16961694
loginBtnHandler={this.loginBtnClickHandler.bind(this)}
16971695
proBtnHandler={this.proBtnClickHandler.bind(this)}
16981696
profileBtnHandler={this.profileBtnClickHandler.bind(this)}
1699-
addLibraryBtnHandler={this.openAddLibrary.bind(this)}
1697+
17001698
runBtnClickHandler={this.runBtnClickHandler.bind(this)}
17011699
isFetchingItems={this.state.isFetchingItems}
17021700
isSaving={this.state.isSaving}
@@ -1798,26 +1796,7 @@ BookLibService.Borrow(id) {
17981796
/>
17991797
</form>
18001798

1801-
<Modal
1802-
show={this.state.isAddLibraryModalOpen}
1803-
closeHandler={async () =>
1804-
await this.setState({ isAddLibraryModalOpen: false })
1805-
}
1806-
>
1807-
<AddLibrary
1808-
js={
1809-
this.state.currentItem.externalLibs
1810-
? this.state.currentItem.externalLibs.js
1811-
: ''
1812-
}
1813-
css={
1814-
this.state.currentItem.externalLibs
1815-
? this.state.currentItem.externalLibs.css
1816-
: ''
1817-
}
1818-
onChange={this.onExternalLibChange.bind(this)}
1819-
/>
1820-
</Modal>
1799+
18211800
<Modal
18221801
show={this.state.isNotificationsModalOpen}
18231802
closeHandler={async () =>

0 commit comments

Comments
 (0)