material-ui icon indicating copy to clipboard operation
material-ui copied to clipboard

[Docs] List example failing due to missing MobileTearSheet

Open c0debreaker opened this issue 10 years ago • 10 comments

Module not found: Error: Cannot resolve 'file' or 'directory' ../../../MobileTearSheet in /Users/admin/repos/asp-log-viewer/app/assets/js

I temporarily made a workaround by changing <MobileTearSheet> to <div>

c0debreaker avatar Jan 30 '16 16:01 c0debreaker

MobileTearSheet is an internal component designed to indicate that the example is truncated. We need to change the path from relative to absolute so the example works externally, but @oliviertassinari should we also add a comment on the code examples to use a div instead?

mbrookes avatar Jan 30 '16 16:01 mbrookes

We need to change the path from relative to absolute

Oh, no that won't help of course since the MobileTearSheet component isn't in the npm.

mbrookes avatar Jan 30 '16 16:01 mbrookes

This component was removed in the next branch. We will no longer have the issue 🎉 . @mbrookes Sorry, I know you liked it.

oliviertassinari avatar Feb 09 '17 17:02 oliviertassinari

@oliviertassinari Don't worry, I'm putting it back! 😈

mbrookes avatar Feb 10 '17 00:02 mbrookes

But uhmmm, why was it removed? ;-(

StephanBijzitter avatar Apr 18 '17 20:04 StephanBijzitter

@StephanBijzitter MobileTearSheet is an internal docs component that adds the zigzag-bottomed outline to List examples. Since it is used in the examples it can cause confusion when the example code is copy pasted.

If we are to maintain the appearance of the examples for the `next branch, we'll have to find an implementation that doesn't have that dependancy.

mbrookes avatar Apr 18 '17 20:04 mbrookes

is not real helpful when the example give does not work :(

Yene-Me avatar Apr 25 '17 10:04 Yene-Me

Having MobileTearSheet in docs is really confusing. Using <div> instead solves the problem.

BALEHOK avatar Jul 26 '17 20:07 BALEHOK

I was really hoping to use <MobileTearSheet> for displaying a receipt 🙁

Ashkin avatar Nov 02 '17 21:11 Ashkin

Paper can be used to overcome this issue

const style = {
    width: 400,
    margin: 20,
    display: 'inline-block',
  };


export default function ListCard() {
    return (
        <Paper style={style} zDepth={3}>
            <List>
                <ListItem primaryText="Inbox" leftIcon={< ContentInbox />}/>
                <ListItem primaryText="Starred" leftIcon={< ActionGrade />}/>
                <ListItem primaryText="Sent mail" leftIcon={< ContentSend />}/>
                <ListItem primaryText="Drafts" leftIcon={< ContentDrafts />}/>
                <ListItem primaryText="Inbox" leftIcon={< ContentInbox />}/>
            </List>
        </Paper>
    )
}

Output:

screen shot 2018-02-07 at 11 49 44 am

shashankKeshava avatar Feb 07 '18 06:02 shashankKeshava